Python / pip

Python / pip: py -m venv .venv — Windows

Create a virtual environment.

Availability: Third-party software; install and version dependent.中文

Syntax

py -m venv .venv

Examples

Create a virtual environment.

py -m venv .venv

Parameters, options and clauses

Option / clauseDescription
--system-site-packagesGive the environment access to system site-packages.
--clearDelete the target environment contents before creation.
--upgradeUpgrade an existing environment to use this Python installation.
--without-pipDo not install pip in the new environment.
--prompt <name>Set the prompt prefix shown for the environment.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory