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

flask-script only works with ancient flask #57

Open
miiichael opened this issue May 23, 2024 · 3 comments
Open

flask-script only works with ancient flask #57

miiichael opened this issue May 23, 2024 · 3 comments

Comments

@miiichael
Copy link

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?

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.

I have these installed.

Flask                            2.2.2
Flask-Breadcrumbs                0.5.1
Flask-Login                      0.6.2
flask-menu                       1.0.1
Flask-Migrate                    4.0.4
Flask-Script                     2.0.6
Flask-SQLAlchemy                 3.0.3
social-auth-app-flask            1.0.0
social-auth-app-flask-sqlalchemy 1.0.1
social-auth-core                 4.5.3
social-auth-storage-sqlalchemy   1.1.0

Also note the warning at the top of https://flask-script.readthedocs.io/en/latest/:
image

@chintanmitv
Copy link

chintanmitv commented Jun 25, 2024

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.

First, uninstall flask_script:

pip uninstall flask_script

Then, install Flask-Script2:

pip install Flask-Script2

Add some necessary chances

@miiichael
Copy link
Author

pip install Flask-Script2

Wow, I smell LLM.

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...

@nijel
Copy link
Member

nijel commented Jun 25, 2024

Indeed, that comment looks weird. Anyway: #50 most likely addresses this issue, but lacks review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants