Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support Python 3.10 #106

Closed
dtrodrigues opened this issue Jan 14, 2022 · 3 comments · Fixed by #107
Closed

Doesn't support Python 3.10 #106

dtrodrigues opened this issue Jan 14, 2022 · 3 comments · Fixed by #107
Labels
bug Something isn't working

Comments

@dtrodrigues
Copy link

dtrodrigues commented Jan 14, 2022

Describe the bug
pmapper cannot run on Python 3.10

To Reproduce

$ pip install  principalmapper==1.1.5
$ pmapper 
Traceback (most recent call last):
  File "/usr/local/bin/pmapper", line 5, in <module>
    from principalmapper.__main__ import main
  File "/usr/local/lib/python3.10/site-packages/principalmapper/__main__.py", line 24, in <module>
    from principalmapper.analysis import cli as analysis_cli
  File "/usr/local/lib/python3.10/site-packages/principalmapper/analysis/cli.py", line 20, in <module>
    from principalmapper.analysis import find_risks
  File "/usr/local/lib/python3.10/site-packages/principalmapper/analysis/find_risks.py", line 37, in <module>
    from principalmapper.querying import query_interface
  File "/usr/local/lib/python3.10/site-packages/principalmapper/querying/query_interface.py", line 26, in <module>
    from principalmapper.querying.local_policy_simulation import *
  File "/usr/local/lib/python3.10/site-packages/principalmapper/querying/local_policy_simulation.py", line 32, in <module>
    from principalmapper.util.case_insensitive_dict import CaseInsensitiveDict
  File "/usr/local/lib/python3.10/site-packages/principalmapper/util/case_insensitive_dict.py", line 34, in <module>
    from collections import Mapping, MutableMapping, OrderedDict
ImportError: cannot import name 'Mapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)

Expected behavior
pmapper to not error

@dtrodrigues dtrodrigues added the bug Something isn't working label Jan 14, 2022
@dylroberts
Copy link

You can fix this issue by modifying the imports in the 'case_insensitive_dict.py' file.

Original:

from collections.abc import Mapping, MutableMapping, OrderedDict

Modified:

from collections.abc import Mapping, MutableMapping
from collections import OrderedDict

@dtrodrigues
Copy link
Author

Closing the issue due to the merge of #107

wdahlenburg pushed a commit to wdahlenburg/PMapper that referenced this issue Sep 5, 2022
@nimaft
Copy link

nimaft commented Nov 30, 2022

I'm running Python 3.10.6 on MacOS Monterey 12.6.1 and still have the same issue, had to change

from collections import Mapping, MutableMapping, OrderedDict

to

from collections.abc import Mapping, MutableMapping
from collections import OrderedDict

to make it work.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants