Command line

virtualenv is primarily a command line application. All options have sensible defaults, and there is one required argument: the name or path of the virtual environment to create.

See Use virtualenv for how to select Python versions, configure defaults, and use environment variables.

Command line options

virtualenv [OPTIONS]

Named Arguments

--version

'==SUPPRESS=='

display the version of the virtualenv package and its location, then exit

--with-traceback

False

on failure also display the stacktrace internals of virtualenv

--read-only-app-data

False

use app data folder in read-only mode (write operations will fail with error)

--app-data

platform specific application data folder

a data folder used as cache by the virtualenv

--reset-app-data

False

start with empty app data folder

--upgrade-embed-wheels

False

trigger a manual update of the embedded wheels

verbosity ⇒ verbosity = verbose - quiet, default INFO, mapping => CRITICAL=0, ERROR=1, WARNING=2, INFO=3, DEBUG=4, NOTSET=5

-v, --verbose

2

increase verbosity

-q, --quiet

0

decrease verbosity

discovery

core ⇒ options shared across all discovery

--discovery

'builtin'

interpreter discovery method; choice of: builtin

-p, --python

the python executable virtualenv is installed into

interpreter based on what to create environment (path/identifier/version-specifier) - by default use the interpreter where the tool is installed - first found wins. Version specifiers (e.g., >=3.12, ~=3.11.0, ==3.10) are also supported

--try-first-with

[]

try first these interpreters before starting the discovery

creator

core ⇒ options shared across all creator

--creator

builtin if exist, else venv

create environment via; choice of: cpython3-mac-brew, cpython3-mac-framework, cpython3-posix, cpython3-win, graalpy-posix, graalpy-win, pypy3-posix, pypy3-win, rustpython-posix, rustpython-win, venv

dest

directory to create virtualenv at

--clear

False

remove the destination directory if exist before starting (will overwrite files otherwise)

--no-vcs-ignore

False

don’t create VCS ignore directive in the destination directory

--system-site-packages

False

give the virtual environment access to the system site-packages dir

--symlinks

True

try to use symlinks rather than copies, when symlinks are not the default for the platform

--copies, --always-copy

False

try to use copies rather than symlinks, even when symlinks are the default for the platform

seeder

core ⇒ options shared across all seeder

--seeder

'app-data'

seed packages install method; choice of: app-data, pip

--no-seed, --without-pip

False

do not install seed packages

--no-download, --never-download

True

pass to disable download of the latest pip/setuptools/wheel from PyPI

--download

False

pass to enable download of the latest pip/setuptools/wheel from PyPI

--extra-search-dir

[]

a path containing wheels to extend the internal wheel list (can be set 1+ times)

--pip

'bundle'

version of pip to install as seed: embed, bundle, none or exact version

--setuptools

'bundle'

version of setuptools to install as seed: embed, bundle, none or exact version

--no-pip

False

do not install pip

--no-setuptools

False

do not install setuptools

--no-periodic-update

False

disable the periodic (once every 14 days) update of the embedded wheels

app-data ⇒ options specific to seeder app-data

--symlink-app-data

False

symlink the python packages from the app-data folder (requires seed pip>=19.3)

activators

core ⇒ options shared across all activators

--activators

comma separated list of activators supported

activators to generate - default is all supported; choice of: bash, batch, cshell, fish, nushell, powershell, python

--prompt

provides an alternative prompt prefix for this environment (value of . means name of the current working directory)