问题
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