对路径中的空格使用virtualenv [英] Using virtualenv with spaces in a path
问题描述
我成立了一个环境的virtualenv我的Mac上,但不能得到画中画安装软件包.它失败,出现以下错误:
I set up a virtualenv environment on my Mac, but cannot get Pip to install packages. It fails with the following error:
/Volumes/Macintosh: bad interpreter: No such file or directory
我一直跟踪到问题所在,直到路径中有空格为止,如下所示: https://stackoverflow.com/a/10873611/126564
(路径为
I tracked the problem down to there being a space in the path, as is answered here: https://stackoverflow.com/a/10873611/126564
(the path being /Volumes/Macintosh HD/Python/my_project
)
但是,这是有点问题的.所提出的解决方案是:
But that's a bit of a problem. The proposed solution is to:
只是把路径你的virtualenv环境没有空格,"
"just put your virtualenv environment in a path without a space,"
但与空间部分是卷本身.的我所有的路径将有一个空间,除非我将它们存储在
but the part with the space is the volume itself. All of my paths would have a space, unless I stored them in a directory of /
. And I don't think "store your stuff outside of user space" is a good solution.
是否有更好的解决这个?
Is there a better solution to this?
推荐答案
试图这样:
- 编辑
,将 ,并更改<4>,让它在你的环境中工作.使用 以检查它是否工作. -
编辑
bin/pip
和bin/easy_install
,将两个文件的第一行更改为
- editing
bin/activate
, changeVIRTUAL_ENV='/Volumes/Macintosh HD/Python/my_project'
, and changePATH="$VIRTUAL_ENV/bin:$PATH"
, to make it work in your environment. usingecho $PATH
to check if it works. editing
bin/pip
andbin/easy_install
, change first line in the two files to
#!/usr/bin/env python
以上2个步骤后,你会让你的virtualenv作品(也PIP/easy_install的).
After above 2 steps, you'll make your virtualenv works(also pip/easy_install).
这篇关于对路径中的空格使用virtualenv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!