【问题标题】:Can't get virtualenvwrapper to work无法让 virtualenvwrapper 工作
【发布时间】:2015-11-04 09:09:46
【问题描述】:

成功运行

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 适用于 *nix 操作系统。

标签: python powershell virtualenvwrapper


【解决方案1】:

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

Windows 命令提示符有virtualenvwrapper-win。也是recommended by virtualenvwrapper

还有instructions for MSYS

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-23
    • 2014-12-26
    • 2017-12-22
    • 2012-02-28
    • 2015-12-01
    • 2012-01-29
    • 2014-12-16
    • 2013-04-19
    相关资源
    最近更新 更多