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.

Choose an environment path whose first % does not start %func or %builtin. On POSIX and in Git for Windows, dash treats those spellings as PATH options during command lookup. Other percent signs are allowed.

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

--venv-redirect

point a PEP-832 .venv redirect file next to the destination at the created environment, even outside a project folder; unset, virtualenv does so only beside a pyproject.toml with no .venv yet

--no-venv-redirect

write no PEP-832 .venv redirect file

--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

--download

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

--no-download, --never-download

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

--extra-search-dir

[]

a directory 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

none

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, xonsh

--prompt

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