Azad Rasul




2- Install Flask in a virtual environment

Azad Rasul's photo
Azad Rasul
·Jan 2, 2023·

1 min read

Play this article

In this tutorial, we use Python 3 and Windows, while Flask also works well on Python 2.7.

Open cmd (Command Prompt) in Windows.

Make a directory and let’s name it “flask-tutorial” using cmd:

mkdir flask-tutorial

Change directory to created folder:

cd flask-tutorial

From cmd as administrator: create a virtual environment, let's name it “venv”

python -m venv venv C:\Users\gardi\flask-tutorial

To activate the virtual environment, change the directory to flask-tutorial:

cd C:\Users\gardi\flask-tutorial

Then activate the virtual environment in cmd:


Install Flask inside “venv” environment using pip install command inside cmd:

pip install Flask

To check if the Flask is installed or not, go to Python inside cmd:


Then import flask package using:

import flask

* If you like the content, please SUBSCRIBE to my channel for the future content

Share this