Create a virtual environment
Create a virtual environment with the current Python3 version.
python3 -m venv <directory>
This will create a virtual environment for the given directory.
Example:
python3 -m venv venv
Activate a virtual environment
If you created a virtual environment from the Create a virtual environment snippet, you can activate a virtual environment for the created virtual environment directory.
source <virtual_environment_directory>/bin/activate
Example:
source venv/bin/activate
Deactivate a virtual environment
Use the deactivate command to exit the virtual environment.
deactivate