Categories
Programming Python

Python Virtual Environments

Because I always forget the syntax for venv in Python.

A link to the Python docs: https://docs.python.org/3/tutorial/venv.html

Create the virtual environment:

python3 -m venv venv

Activate it:

source venv/bin/activate

Your terminal will show the name of the venv in parenthesis:

sm@pop-os:~/projects/tutorials/pyoop
>$ source venv/bin/activate
(venv) sm@pop-os:~/projects/tutorials/pyoop
>$