Flask-Script: from flask._compat import text_type ModuleNotFoundError: No module named 'flask._compat'
1 - I did installed modules manualy on PyCharm\settings\projet: myapp\python interpreter
by selecting my interpreter and installing libs missed like Flask
itself, flask-migrate
and flask-script
.
2 - On this specific error: from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat'
-
It happened because the python searched on Flask._compat
directory and It isn't there, so I changed like on below : (on flask_script/__init__.py
)
Where:
from ._compat import text_type
on original flask-script file
to :
from flask_script._compat import text_type
Then It works !!
I removed "from flask_script import Manager"and removed "manager = Manager(app)" from my main app.
And from the requirements.txt file.
Found on github:flask_script is not flask itself, but a (dead - repo archived) flask extension written by someone else.
Now my program runs with Flask 2.0.1