21 May 2023
Creating Python Virtual Environments on Ubuntu with venv
To create a Python virtual environment using venv on Ubuntu:
- Install virtualenv:
pip3 install virtualenv
- Create the virtual environment:
python3 -m venv myenvname
(where "myenvname" is the desired name for the environment) Reference: https://docs.python.org/3/library/venv.html - Activate the virtual environment:
source myenvname/bin/activate
You may also like