You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ModuleNotFoundError: No module named 'flask._compat'
What are the steps to reproduce this issue?
git clone https://github.com/python-social-auth/social-examples cd social-examples/example-flask python3 manage.py
Any logs, error output, etc?
Traceback (most recent call last):
File "/mnt/home/michael/docs/dev/social-examples/example-flask/manage.py", line 3, in <module>
from flask_script import Manager, Server, Shell
File "/home/michael/.local/lib/python3.11/site-packages/flask_script/__init__.py", line 15, in <module>
from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat'
Any other comments?
Expand the issue with any details you find appropriate to solve or reproduce it.
the error you're encountering indicates that the flask_script package is trying to import a module (flask._compat) that no longer exists in the latest versions of Flask. This is likely due to the flask_script package being outdated.
Here are a few ways to resolve this issue:
Update to Flask-Script2:
Flask-Script is no longer maintained. A fork called Flask-Script2 is available, which might resolve the issue.
michael@foo:~/dl$ pip download Flask-Script2
ERROR: Could not find a version that satisfies the requirement Flask-Script2 (from versions: none)
ERROR: No matching distribution found for Flask-Script2
And/or an incompetent attempt at supply chain attack...
Expected behaviour
A working Flask example, to help noobs like me...
Actual behaviour
ModuleNotFoundError: No module named 'flask._compat'
What are the steps to reproduce this issue?
git clone https://github.com/python-social-auth/social-examples
cd social-examples/example-flask
python3 manage.py
Any logs, error output, etc?
Any other comments?
Expand the issue with any details you find appropriate to solve or reproduce it.
I have these installed.
Also note the warning at the top of https://flask-script.readthedocs.io/en/latest/:
The text was updated successfully, but these errors were encountered: