LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virtualenv

Create isolated Python environments

TLDR

Create a virtual environment
$ virtualenv [venv]
copy
Create with specific Python
$ virtualenv -p [python3.11] [venv]
copy
Create without pip
$ virtualenv --no-pip [venv]
copy
Create with system packages
$ virtualenv --system-site-packages [venv]
copy
Activate the environment (bash/zsh)
$ source [venv]/bin/activate
copy
Activate the environment (fish)
$ source [venv]/bin/activate.fish
copy
Deactivate the environment
$ deactivate
copy
Create with latest seed packages
$ virtualenv --download [venv]
copy

SYNOPSIS

virtualenv [options] dest

DESCRIPTION

virtualenv creates isolated Python environments. Each environment has its own Python binary and independent set of installed packages, allowing different projects to have different dependencies without conflicts.When activated, the virtual environment modifies PATH to use the environment's Python and pip, isolating package installations from the system Python. This is essential for reproducible development environments.virtualenv is the original virtual environment tool for Python, predating the built-in venv module. It offers additional features like choosing Python versions and faster environment creation.

PARAMETERS

-p python, --python= python

Python interpreter to use.
--system-site-packages
Give access to system site-packages.
--no-pip
Don't install pip.
--no-setuptools
Don't install setuptools.
--no-wheel
Don't install wheel.
--download
Download latest pip/setuptools/wheel.
--no-download
Use bundled pip/setuptools/wheel.
--clear
Clear existing environment.
--copies
Use copies instead of symlinks.
--prompt text
Custom prompt prefix for the activated environment.
--activators list
Activators to generate (comma-separated: bash, fish, cshell, powershell, etc.).
-v, --verbose
Increase verbosity.
-q, --quiet
Decrease verbosity.

INSTALL

sudo apk add py3-virtualenv
copy
brew install virtualenv
copy
nix profile install nixpkgs#virtualenv
copy

CAVEATS

Environment must be activated in each new shell. Absolute paths are embedded in the environment, making it non-relocatable. Python version must exist on system. Consider using python -m venv for basic needs.

HISTORY

virtualenv was created by Ian Bicking in 2007 to address Python's lack of built-in environment isolation. It became the standard tool for Python development before venv was added to the standard library in Python 3.3. virtualenv remains popular due to additional features and Python 2 support (historical).

SEE ALSO

python(1), pip(1), pyenv(1), venv(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid