Virtual Environment walkthrough and Flask installation

Imagine you live in your 1 room big house having the size of 40 feet by 50 feet. The house doesn't have any separate rooms and you live with your family. You want to make a video of yours practising playing guitar but you aren't able to follow the metronome ticks due to the distractions of the people moving in front of you.

What would be the viable solution to carry out the passion of playing guitar or recording it?

You might move to a separate room. But to construct a separate room it would put a dent on your wallet. How about you cordon off a small area with curtains? That would be feasible as well as it would help you in cutting off the distractions and you could carry on with your passion of playing the guitar and mastering it.

Virtual environment works in the same manner like the makeshift guitar practising room.

You could install packages and libraries and work on your projects without impacting the global environment.

To get started let's dive in ...

  • Open Terminal

1S.png

  • Select the drive you want work on (Eg : I would be selecting Desktop)
cd Desktop

2.png

  • Create the directory (Eg : The directory created is Project)
mkdir Project

3.png

  • Get inside the Project folder
cd Project

5.png

  • Install the Virtual environment (Eg : 'project_env' as Virtual environment)
python3 -m venv Project_env

6.png

  • List out all the files in the Project folder
ls

7.png

  • List out all the packages which are installed
pip freeze
  • Activate the virtual environment
source project_env/bin/activate

8.png

  • The name of the Virtual environment comes in front after it's activation

9.png

  • Install a Python library say Flask
pip install flask

10.png

After Installation

11.png

  • Verifying the proper Installation
python

12.png

import flask

13.png

If no errors are shown then it means that the module has been installed correctly.

Thanks for reading.

Drop in your suggestions.

Brickbats and Bouquets are welcome.

Did you find this article valuable?

Support Devkant Swargiary by becoming a sponsor. Any amount is appreciated!