07. Sep 2023
1 min
Using a virtual environment in Python is good practice for keeping project dependencies separate. Install the python3-venv package with sudo apt install python3-venv. Then create a new virtual environment with python3 -m venv myenv. Activate it with source myenv/bin/activate. You can now install packages that will only be available inside this virtual environment.