I want to use Flask to develop a website but I am having already problems getting a simple demo app running.
I followed the complete installation tutorial of the flask website
Means:
- I created a project directory.
- Inside this directory I created my virtualenv folder like described in the tutorial.
- I started the virtual environment using . venv/bin/activate
- I installed flask inside the virtualenv by pip install Flask
If I now open the python console via python (while running venv) and I try from flask import Flask I get the error:
Traceback (most recent call last): File "", line 1, in ImportError: No module named 'flask'
Also running a simple Hello World app like the following gives the same error.
If I try to install flask again in venv, the following is shown in the console:
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "hello world"
if __name__ == "__main__":
application.run()
For completeness: I already searched a lot on SO and google but could not find the same problem. Although I found a few related all of them had the problem that the one asking either forgot installing flask inside venv or forgot activating venv etc.
Also if I type which python it points correctly to the folder bin/python inside my venv folder.