Setup and use Python Venv in Python Applications
Wesley Bertipaglia
Posted on April 11, 2024
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
💖 💪 🙅 🚩
Wesley Bertipaglia
Posted on April 11, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.