Install Flask Python Like a Pro: The Ultimate Step-by-Step Tutorial

Logan Jul 13, 2026

Python is a versatile language widely used for web development, data analysis, AI, and countless more use-cases. When it comes to building web applications, Flask, a Python-based micro web framework, is an excellent choice. It's lightweight, flexible, and has an extensive community support, making it a go-to for many developers. So, let's explore how to install Flask on your Python environment.

the logo for flask web development, one drop at a time with an image of a chili pepper
the logo for flask web development, one drop at a time with an image of a chili pepper

Before beginning, ensure you have Python 3.6 or later installed on your system. Python's package installer, pip, comes bundled with Python, so no need to install it separately.

The Flask Mega-Tutorial, Part I: Hello, World!
The Flask Mega-Tutorial, Part I: Hello, World!

Installing Flask via pip

pip is the standard way to install Flask. It's a package manager for Python, a bit like npm for Node.js or gem for Ruby.

Create one executable file for a Flask app with PyInstaller
Create one executable file for a Flask app with PyInstaller

Open your terminal or command prompt and type the following command to install Flask:

pip install flask

After running this command, pip will fetch and install Flask from the Python Package Index (PyPI). Once installed, verify Flask is set up correctly by opening a Python shell and typing:

Learning python(Flask)
Learning python(Flask)

import flask

If there are no errors, you've successfully installed Flask.

Verifying the Installation

To further validate Flask is working, you can create a simple server. In a new Python file (e.g., app.py), write the following code:

| Pythonista Planet
| Pythonista Planet

```python from flask import Flask app = Flask(__name__) @app.route('/') def home(): return "Hello, World!" if __name__ == "__main__": app.run(port=5000, debug=True) ```

Then run your application using
python app.py

Open your web browser and navigate to http://127.0.0.1:5000/. You should see "Hello, World!" displayed, indicating that Flask is running smoothly.

Upgrading or Uninstalling Flask

How to configure Flask in Python in windows
How to configure Flask in Python in windows

To upgrade Flask to the latest version, use:

pip install --upgrade flask

If you want to uninstall Flask, use:

a laptop with the words flask series getting started on it and a rubber duck
a laptop with the words flask series getting started on it and a rubber duck
Build Your First Python API in 6 Steps | Flask Tutorial for Beginners
Build Your First Python API in 6 Steps | Flask Tutorial for Beginners
Python Flask TODO App: Build a Web App with SQLite from Scratch
Python Flask TODO App: Build a Web App with SQLite from Scratch
Flask Project Structure: Build a Scalable Web App – Real Python
Flask Project Structure: Build a Scalable Web App – Real Python
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python Training | Edureka
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python Training | Edureka
Getting Started with Flask, a Python Microframework — SitePoint
Getting Started with Flask, a Python Microframework — SitePoint
| Pythonista Planet
| Pythonista Planet
Web Development with Python Tutorial – Flask & Dynamic Database-Driven Web Apps
Web Development with Python Tutorial – Flask & Dynamic Database-Driven Web Apps
Using Flask on the Raspberry Pi: A Comprehensive Guide
Using Flask on the Raspberry Pi: A Comprehensive Guide
01 Python Flask, Installation , Configuration and first Flask app | by Chitrank Dixit
01 Python Flask, Installation , Configuration and first Flask app | by Chitrank Dixit
Python Flask Tutorial 3 - Flask Templates
Python Flask Tutorial 3 - Flask Templates
Python Flask Tutorial 5 - Database with Flask-SQLAlchemy
Python Flask Tutorial 5 - Database with Flask-SQLAlchemy
Building My Portfolio Website Using Python Flask
Building My Portfolio Website Using Python Flask
Python Flask Tutorial 7 - Building Flask CRUD Application | CRUD Operations (Part 1 of 2)
Python Flask Tutorial 7 - Building Flask CRUD Application | CRUD Operations (Part 1 of 2)
Seat Reservation System With Python Flask
Seat Reservation System With Python Flask
15 Fun Raspberry Pi Projects to Experiment with Python
15 Fun Raspberry Pi Projects to Experiment with Python
Python REST API Tutorial - Building a Flask REST API
Python REST API Tutorial - Building a Flask REST API
Deploy Your Flask App Like a Pro: Nginx, Gunicorn, SSL & Custom Domain Setup
Deploy Your Flask App Like a Pro: Nginx, Gunicorn, SSL & Custom Domain Setup
Python tkinter Toolbox
Python tkinter Toolbox
Navigating the Flask vs Django Dilemma: Choosing the Right Python Framework for Your Project
Navigating the Flask vs Django Dilemma: Choosing the Right Python Framework for Your Project

pip uninstall flask

Remember to save a copy of your working code before uninstalling, as it will delete files related to the package.

irtual Environments and Flask

When working on Flask projects, using virtual environments is a best practice. It keeps your project dependencies separate from your system's Python environment.

To create a new virtual environment, navigate to your project directory and run:

python -m venv myenv

To activate it, use:

  • indows: myenv\Scripts\activate
  • Unix/Mac: source myenv/bin/activate

Once activated, install Flask as shown above. Deactivate your environment with deactivate when you're done.

Flask offers an excellent balance between simplicity and functionality, making it an ideal choice for both beginners and seasoned web developers. So, explore the extensive Flask documentation and start building your web applications today!