How To Fix “flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’”?
Are you having problems with the issue “flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’“? How to fix it? In today’s article, I will provide solutions for you to solve the issues. Please follow the below steps to get the problem resolved now
How did “flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’” occur?
flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’
When you work with Python, you may get the issue flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’. Don’t worry, we are here to provide you solutions in order to resolve your problem.
How to fix “flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’”?
To Solve flask._compat Import text_type ModuleNotFoundError The following commands can be used in place of FlaskScript
Solution 1: Degrade Flask
Flask version 2.0.0 should be degraded to 1.1.2. It will work. FlaskScript can also be used with the following commands:
flask db init # to initialize the database
flask db migrate # to migrate new changes
flask db upgrade # to upgrade and so on.
Solution 2: Use Flask 1.1.4
Flask 1.1.4 was installed.
pip install "Flask==1.1.4"
Also, werkzeug
pip install "werkzeug==1.0.1"
Final words
The above are useful solutions that can help you fix “flask._compat import text_type ModuleNotFoundError: No module named ‘flask._compat’” problem, if you can’t solve it well. Please leave a message.