Python Flask installation - Web development with Python Flask
Keyboard shortcuts
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
Python Flask installation
There is nothing special. You install flask as you’d install any other Python package. Using some kind of virtual envrionment is recommended here too.
Linux / macOS
mkdir project
cd project
virtualenv .venv -p python3
source .venv/bin/activate
pip install Flask
Windows
mkdir project
cd project
virtualenv .venv -p python3
.venv\Scripts\activate
pip install Flask
Install using uv
uv is avery fast package and project manager. After installing uv you can do the following.
$ uv init flask-demo
$ cd flask-demo
$ uv add flask
Rename the main.py file to app.py to make it easier to follow along.
$ uv run flask run