Python - Setting Up A Virtual Environment


2 min read

Creating a virtual environment

  • Change to the project directory
  • Run the following command:
1virtualenv -p python3 venv

Note: venv is the name of the virtual environment, and can be changed. venv is the convention


Activating a virtual environment

1source venv/bin/activate

Leaving / deactivating a virtual environment

1deactivate

Helpful links

Previous post:
Python - Pip Commands
Next post:
Docker - Stop And Remove All Containers

Discussion