如果您使用virtualenvwrapper-win
, 并使用 DOS 命令提示符(而不是例如 Powershell),则使用以下命令创建新的 virtualenvs:
mkvirtualenv myenv
并使用激活
workon myenv
您应该定义环境变量WORKON_HOME
以指向您希望 virtualenvs 驻留的位置。
如果您已安装virtualenvwrapper-win>=1.2.4
,则该virtualenvwrapper
命令将为您提供可用命令列表:
go|c:\srv> virtualenvwrapper
virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv
tool. The extensions include wrappers for creating and deleting
virtual environments and otherwise managing your development workflow,
making it easier to work on more than one project at a time without
introducing conflicts in their dependencies.
virtualenvwrapper-win is a port of Dough Hellman's virtualenvwrapper to Windows
batch scripts.
Commands available:
add2virtualenv: add directory to the import path
cdproject: change directory to the active project
cdsitepackages: change to the site-packages directory
cdvirtualenv: change to the $VIRTUAL_ENV directory
lssitepackages: list contents of the site-packages directory
lsvirtualenv: list virtualenvs
mkproject: create a new project directory and its associated virtualenv
mkvirtualenv: Create a new virtualenv in $WORKON_HOME
rmvirtualenv: Remove a virtualenv
setprojectdir: associate a project directory with a virtualenv
toggleglobalsitepackages: turn access to global site-packages on/off
virtualenvwrapper: show this help message
whereis: return full path to executable on path.
workon: list or change working virtualenvs