flask-nav
flask-nav copied to clipboard
AttributeError on Python 3.10
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'
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
There is a Pull Request to resolve this problem. @mbr Can you handle the PR?
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 *