Python Venv is a built-in tool to create and manage lightweight virtual environments.
For more information visit: venv tutorial.
Installation:
Already installed on MacOS and Windows platforms, but needs to be installed on some Linux distros, here is an installation guide for different package managers:
sudo apt install python3-env # using apt
sudo dnf install python3-env # using dnf
sudo pacman -S python3-env # using pacman
Creating a Virtual Environment:
python -m venv <env_name> # Unix-like systems
python -m venv <env_name> # windows
Activating the Virtual Environment:
- On Unix-like systems (Unix, Linux, or MacOS): ```bash
source /bin/activate
- On Windows:
```bash
<env_name>\Scripts\activate
Deactivating the Virtual Environment:
deactivate
Top comments (0)