Create a virtual environment

Open the directory where you want to create your project.

Open a Terminal and navigate to the same directory and run the following commands to create a virtual environment.

1
python -m venv venv

Activat

Now you have our virtual environment, activate it.

1
venv\Scripts\activate

Install modules

You can install modules in 2 ways:

pip install

Use pip install and install each module one at the time

1
pip3 install "module name"

requirements.txt

You can create an requirements.txt file and list the modules in that file

1
pip3 freeze > requirements.txt

then install all the modules:

1
pip3 install -r requirements.txt