Skip to the content.

venv

Information

Python own virtual environment tool module.

Usage, tips and tricks

Check python version

Windows

py --version

*nixes

python --version
# or
python3 --version

Example use case

mkdir example-software
cd example-software

Windows

py -3.9 -m venv ./.venv
.\.venv\Scripts\activate

*nixes

# On Linux
python -m venv ./.venv
source ./.venv/bin/activate
# cd ./.venv/bin

continue:

python -m pip install --upgrade pip
pip --version
pip install imageio
pip install jupyterlab notebook voila
pip install tensorflow tensorflow-transform tfds-nightly matplotlib pandas
pip freeze > requirements.txt
# to install frozen packages
pip install -r requirements.txt
pip install -r requirements.txt --upgrade
pip install -r requirements.txt -r requirements-ai.txt
# Upgrade some package
pip install <package_name> --upgrade

See also

Virtual environments tutorial

venv

pip installer