Python venv

From Bitnami MediaWiki
Revision as of 17:12, 29 November 2022 by 98.152.106.150 (talk)
Jump to navigation Jump to search

Establish a new virtual environment:

python -m venv venv

Next, activate it:

source venv/bin/activate

You should see the new prompt indicating you're inside the virtual environment:

(venv) $

Next install the versions you need of various packages, specifying their version numbers:

pip install numpy==1.22.0

To exit, type:

(venv) $ deactivate

Reference: Python virtual environments: A primer