DEV Community

Cover image for Install Flask { in Windows, Linux, MacOS } | Mega flask tutorial
Raman Bansal
Raman Bansal

Posted on

Install Flask { in Windows, Linux, MacOS } | Mega flask tutorial

For initial setup firstly we will install flask. After that we understand to create a hello world program with the help of flask.

To install flask, we will use virtual environment. A virtual environment is a private copy of the Python interpreter onto which you can install packages privately, without affecting the global Python interpreter installed in your
system.

How to install flask with the help of Virtual Environment

Run the following commands step by step for setup

Step 1: Installing virtual environment

For Linux

//Debian, Ubuntu
$ sudo apt-get install python-virtualenv
//CentOS, Fedora
$ sudo yum install python-virtualenv
//Arch
$ sudo pacman -S python-virtualenv
Enter fullscreen mode Exit fullscreen mode

For windows

> mkdir myproject
> cd myproject
> py -3 -m venv venv
Enter fullscreen mode Exit fullscreen mode

Step 2: Activating Virtual Environment

To install flask, firstly we need to activate virtual environment. To do that run the following commands.

For Linux

$ .venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

For windows

> venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode

Step 3: Installing Flask

After installing virtual environment, install the flask with the help PyPi. Run the following command after activating virtual environment.

(venv) $ pip install Flask
Enter fullscreen mode Exit fullscreen mode

Now, Flask is installed. You may create web apps from it.

Read the full article
Flask installation

Top comments (0)