Flask is not importing even though I installed it

Try to install flask with specific version of python, do something like:

python[version] -m pip install flask

Note: replace [version] with python version (such as python3).


Sounds like the pip you are using is not installing for the same python you are using.

try which pip and which python

the they should be in the same folder. Might want to make an alias or two if you have a bunch of pythons (sys, 2, 3, conda etc) or just start with a fresh virtual env for your project. <- best imo.


When you typed pip install flask in the command prompt, it installed flask in the global environment. That is the reason when you run it in command line it works because it used global environment by default.

Pycharm has a virtual environment, therefore you need to install it in that virtual environment. Open Pycharm, then open the terminal within Pycharm and type "pip install flask".

You can read about virtual environment in python to get a clear idea.