less than 1 minute read

In this article, we will try to lean about creating virtual environment in Python.

Creating Virtual Environment

Creating a virtual environment in Python is easy task. Before creating a virtual environment, make sure pip is installed and updated.

pip install virtualenv

Use below command in Command Prompt to create the virtual environment:

virtualenv NameOfTheVirtualEnvironment

Once the environment is created, make sure environment is activated. To activate the virtual environment, use below command:

PathToVirtualEnvironment/Scripts/Activate

To deactivate the virtual environment, use below command:

PathToVirtualEnvironment/Scripts/Deactivate

To check the version of Python, use below command:

python --version

Thank you for reading.

Updated: