[SOLVED] How to Fix ImportError No module named 'flask' with virtualenv

preview_player
Показать описание
Import Error is the most common error you will encounter in the python programming, especially if you are new to python. The error says that the python interpreter cannot find the libraries which you are referring to in the code. Though the module is already installed.

There could be different reasons for this error. Most common ones are

1. Using modules meant for different python versions. Installing python 2.x modules in python 3.x and vice a versa.

2. Improper setting of the PATH variable.

3. If you are using a python virtual environment. This virtual environment requires activation and dedicated installation of modules inside the virtual environment. It has to be installed after creating a virtual environment. The libraries will reside inside the folder created for the virtual environment.

Subscribe to my channel:
Twitter @iTwittt
Рекомендации по теме
Комментарии
Автор

from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat'


I have this problem :((

natalia
Автор

how to exit and get into the created env??

WizardBrew
Автор

my virtual enviroment is activated but the module flask_restful is not found after installing it

mmustap
Автор

thanks for the video sir, what if when i have the correct version i am still getting this error? form my research i think it is an issue with the interpreter

EUU
Автор

after writing virtualenv virtual_env, I will see this error: "bash: virtualenv: command not found"
Why? What I must du?

doostjoon