无法让 virtualenvwrapper 工作 [英] Can't get virtualenvwrapper to work

查看:47
本文介绍了无法让 virtualenvwrapper 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

成功运行

pip install virtualenvwrapper

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

but I can't get the next two commands to run.

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 工作:

I assume my problem is that I don't know what I'm doing with PowerShell. Originally, I couldn't get pip or virtualenv to work at all until I entered:

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

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

Once I did that I was able to run pip or virtualenv from any location without problems. What I can't figure out is how to successfully run the last two lines specified at the virtualenvwrapper page.

推荐答案

virtualenvwrapper 适用于类 Unix 操作系统,例如Linux 和 OS X.看看 virtualenvwrapper-powershell.它是virtualenvwrapper 官方推荐.

virtualenvwrapper is for Unix-like operating systems, e.g. Linux and OS X. Take a look at virtualenvwrapper-powershell. It's officially recommended by virtualenvwrapper.

Windows 命令提示符有 virtualenvwrapper-win.它也是 virtualenvwrapper 推荐.

There's virtualenvwrapper-win for the Windows Command Prompt. It's also recommended by virtualenvwrapper.

还有MSYS 说明.

这篇关于无法让 virtualenvwrapper 工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆