Β» pip install Flask
Videos
Install pip as described here: How do I install pip on Windows?
Then do
pip install flask
That installation tutorial is a bit misleading, it refers to actually running it in a production environment.
First install flask using pip,
pip install Flask
* If pip is not installed then install pip
Then copy below program (hello.py)
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
Now, run the program
python hello.py
Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Just copy paste the above address line in your browser.
Reference: http://flask.pocoo.org/
Factsheet
/ 19 February 2026; 47 days ago (19 February 2026)
/ 19 February 2026; 47 days ago (19 February 2026)
You seem to have a permission issue. From the log you pasted to pastebin:
error: could not create '/usr/local/lib/python3.4/dist-packages/flask': Permission denied
This is because pip will attempt to install the package globally unless you specify a certain installation location. If you want to install this globally you must use sudo or install as a user with privileges.
Try the following:
sudo pip3 install flask
Or specify to a certain dir:
pip install -t <path> flask
However, with the latter method you will have to always inject the path to sys.modules so I suggest you just use sudo if you can.
Or even more preferrably, use virtualenv. Virtualenv allows you to very easily package your application for production because you can install only the packages you need and you've thus got automatic package isolation. Generating a requirements.txt is then as simple as pip freeze > requirements.txt. Remeber that if you end using a virtualenv, you must not use sudo to install packages as they will then be installed outside the virtualenv.
For Python 3.6.4 version, it is possible to install Flask by doing:
sudo pip3.6 install flask