Open In App

How to Install Flask in Windows?

Last Updated : 21 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Flask is basically a Python module. It can work with Python only and it is a web-developing framework. It is a collection of libraries and modules. Frameworks are used for developing web platforms. Flask is such a type of web application framework. It is completely written in Python language. Unlike Django, it is only written in Python. As a new user, Flask is to be used. As it is easier to handle. As it is only written in Python, before installing Flask on the machine, Python should be installed previously.  

Features of Python Flask:

  • Flask is easy to use and easily understandable for new users in Web Framework.
  • It can also be used as any third-party plugin extension.
  • It is also used for prototyping purposes.

Install Virtual Environment

We use a module named virtualenv which is a tool to create isolated Python environments. virtualenv creates a folder that contains all the necessary executables to use the packages that a Python project would need.

pip install virtualenv

Create Python virtual environment

Go to the local directory where you want to create your Flask app.

virtualenv venv

Activate a virtual environment based on your OS

For windows > venv\Scripts\activate
For linux > source ./venv/bin/activate
Install Virtual Environment

 

Install Flask on Windows or Linux

Step 1: Make sure that Python PIP should be installed on your OS. You can check using the below command.

pip -V
or
pip --version

Step 2: At first, open the command prompt in administrator mode. Then the following command should be run. This command will help to install Flask using Pip in Python and will take very less time to install. According to the machine configuration, a proper Flask version should be installed. Wait for some time till the process is completed. After completion of the process, Flask is completed successfully, the message will be displayed. Hence Installation is successful.

pip install flask
Install Flask on Windows

 

Step 3: After that, also the following two commands should be run. These commands will start Flask in the command prompt. Hence, the process is completed successfully.

python
import flask
Install Flask on Linux

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads