Creating virtual environment

Before creating a virtual environment, let's first create a directory in which we will set up the environment.

To create the directory, run the following command on your terminal:

mkdir lab-venv-dir

 

Now change your current working directory by the command:

cd lab-venv-dir

 

To create a virtual environment in this directory, run the following command:

python3 -m venv lab-venv

This command sets up a new directory 'lab-venv' which creates various supporting files for your virtual environment. You can list the contents of this directory by the command: 

ls lab-venv

 

Congrats! You have successfully created a virtual environment.🥳

Discussion

1

0