An example of the virtualenv command being used. After the virtualenv is activated, python packages inside of it are available for use.

virtualenv is a software program to create isolated Python package environments.

By default, python programs will have access to python packages in the program's directory and packages that are system-wide; these system-wide packages are shared between different python programs. virtualenv allows for the creation of python environments that are not necessarily shared between python programs.

Since Python 3.3, the venv module is available in the python standard library. The venv module contains a subset of functionality of the virtualenv package.

Usage

virtualenv is typically used like this:

virtualenv venv

This creates a new "virtual environment" in the directory venv. Then if the environment is activated with an activation script:

source venv/bin/activate

Subsequent calls to the python commands will use the virtualenv venv.

See the official virtualenv usage guide for more information.

History of virtualenv

virtualenv was created by Ian Bicking in September of 2007, as a replacement for his former project, workingenv. virtualenv's primary maintainer, as of 2022, is Bernát Gábor.

virtualenv is part of the Python Packaging Authority (PyPA) working group.