我正在尝试使用Windows 10命令提示符创建并激活虚拟环境。我知道virtualenv安装正确,命令如下
virtualenv venv很管用。我已经导航到我的virtualenv下载,Downloads\ venv \Scripts,并且正在尝试激活我的虚拟环境venv。我试过了
venv activate这不起作用,因为Windows不会将venv识别为命令。我也试过
virtualenv venv activate这也不起作用,因为virtualenv说"venv activate“不是一个有效的参数。
发布于 2020-05-08 20:54:13
使用虚拟环境的脚本目录中的activate脚本:
> venv\Scripts\activate这将激活您的虚拟环境,根据您所在的目录,您的终端将如下所示:
(venv) C:\Users\acer\Desktop>我希望这能帮到你!
发布于 2017-12-02 07:47:22
如果您正在使用virtualenvwrapper-win,并使用DOS命令提示符(而不是Powershell),那么可以使用以下命令创建新的virtualenv:
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发布于 2021-09-12 10:30:59
转到您在cmd中创建虚拟环境的文件夹,然后输入命令.\venv\Scripts\activate It将在windows中激活虚拟环境
https://stackoverflow.com/questions/46896093
复制相似问题