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

AttributeError on Python 3.10 #28

Open
lexdene opened this issue May 30, 2022 · 3 comments · May be fixed by #27
Open

AttributeError on Python 3.10 #28

lexdene opened this issue May 30, 2022 · 3 comments · May be fixed by #27

Comments

@lexdene
Copy link

lexdene commented May 30, 2022

I am using flask-nav==0.6 on Python 3.10.4 and meet this error:

  File "/usr/local/lib/python3.10/site-packages/flask_nav/__init__.py", line 49, in <module>
    class ElementRegistry(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
@pndiku
Copy link

pndiku commented Jul 9, 2022

You need to edit the file flask_nav/__init__.py

and change line 49 to

class ElementRegistry(collections.abc.MutableMapping):

The library is pretty old so I just created my one fork and will start looking for alternatives

@paullilley
Copy link

There is a Pull Request to resolve this problem.
@mbr Can you handle the PR?

@jeff-dh
Copy link

jeff-dh commented Mar 31, 2023

This is a hack, but it "fixes" the issue in user space:

    import collections
    collections.MutableMapping = collections.abc.MutableMapping
    from flask_nav import Nav
    from flask_nav.elements import *

@shepherdjay shepherdjay linked a pull request Apr 25, 2023 that will close this issue
louking added a commit to louking/mysql-docker that referenced this issue Oct 2, 2024
louking added a commit to louking/mysql-docker that referenced this issue Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants