Installing Flask
Flask is a package — a collection of Python code written by other developers and shared with the world. Before you can use it, you need to download and install it. Python has a built-in tool for exactly this: pip.
What is pip?
pip is Python's package installer. It connects to a massive online library of Python packages (called PyPI — the Python Package Index) and downloads whatever you ask for.
Think of it like an app store, but for Python code. Developers publish their packages there, and you install them with one command.
Flask lives on PyPI. Installing it is one line.
Installing Flask
Open a terminal. On Windows, that is either Command Prompt, PowerShell, or the terminal built into VSCode (which is the easiest — press Ctrl + ` to open it).
=== "Windows"
```
pip install flask
```
=== "Mac"
```
pip3 install flask
```
=== "Linux"
```
pip3 install flask
```
If you are using a virtual environment
If you have activated a virtual environment (a good habit), the command is pip install flask on all platforms — the virtual environment handles it.
You will see a list of packages being downloaded and installed. Flask brings a few small dependencies with it — that is normal.
Check that it worked
Run this:
pip show flask
You should see something like:
Name: Flask
Version: 3.x.x
...
If you see that, Flask is installed and ready.
Other names appearing during install?
You might see other package names scroll by when you run pip install flask. That is normal — Flask uses a few other packages to do its job, and pip grabs them all for you automatically. You do not need to know what they are.
Challenge
Run pip show flask in your terminal. If you see Flask's name and version printed back at you, you are ready to move on.
← How Do People See Our Pages? Next: The Project Structure →