Can't get virtualenvwrapper to work

假如想象 提交于 2020-07-19 10:52:55

问题


Successfully ran

pip install virtualenvwrapper

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

PS C:> export WORKON_HOME=~/Envs

Error is:

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

Error is:

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

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")

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.


回答1:


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.

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

There are also instructions for MSYS.



来源:https://stackoverflow.com/questions/31953682/cant-get-virtualenvwrapper-to-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!