I am following these steps to learn flask http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world/page/0#comments
I ran this command to create
This problem can also arise if the port is not available. Try running on different port.
Make sure your virtualenv is activated. Then You check on the PYTHONPATH
of that virtualenv. Is there a flask package (folder) installed in that directory.
If you unsure whether you have installed flask, just run the following command to see all the packages you have installed pip list
or pip show flask
. Do you see flask there? If not you can run pip install flask
If nothing else helps, check that in your code it is:
from flask import Flask
I've tried many things before I've noticed my mistake. I had this in my code:
from Flask import Flask
When I have changed capitalized letter for the module name, i.e. flask
then everything worked.
Activate your virtual environment first with
source bin/activate envName
Then try to run your command again
I am running Python on windows 7. I had same problem No module named flask.
I tried reinstalling python, venv but it did not work.
Finally i run it like this
I had this same problem on three Raspberry Pi units at the same time; beat my head against the wall trying to fix it for several hours (reinstall flask via pip, apt and aptitude - no joy).
Instead of:
pip install flask
I finally tried:
pip install Flask
Worked like a charm.