gpt4 book ai didi

python - 无法让 virtualenvwrapper 工作

转载 作者:太空宇宙 更新时间:2023-11-04 05:46:44 25 4
gpt4 key购买 nike

运行成功

pip install virtualenvwrapper

但我无法运行接下来的两个命令。

PS C:> export WORKON_HOME=~/Envs

错误是:

The term 'export' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:7
+ export <<<< WORKON_HOME=~/Envs
+ CategoryInfo : ObjectNotFound: (export:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:> source /usr/local/bin/virtualenvwrapper.sh

错误是:

The term 'source' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:7
+ source <<<< /usr/local/bin/virtualenvwrapper.sh
+ CategoryInfo : ObjectNotFound: (source:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我想我的问题是我不知道我在用 PowerShell 做什么。最初,我无法让 pipvirtualenv 工作,直到我输入:

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\Scripts", "User")

一旦我这样做了,我就能够从任何位置毫无问题地运行 pipvirtualenv。我想不通的是如何成功运行 virtualenvwrapper 页面上指定的最后两行。

最佳答案

virtualenvwrapper 适用于类 Unix 操作系统,例如Linux 和 OS X。看看 virtualenvwrapper-powershell .这是officially recommended by virtualenvwrapper .

virtualenvwrapper-win适用于 Windows 命令提示符。也是recommended by virtualenvwrapper .

还有instructions for MSYS .

关于python - 无法让 virtualenvwrapper 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31953682/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com