对路径中的空格使用virtualenv [英] Using virtualenv with spaces in a path

查看:81
本文介绍了对路径中的空格使用virtualenv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成立了一个环境的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/pipbin/easy_install,将两个文件的第一行更改为

  • editing bin/activate, change VIRTUAL_ENV='/Volumes/Macintosh HD/Python/my_project', and change PATH="$VIRTUAL_ENV/bin:$PATH", to make it work in your environment. using echo $PATH to check if it works.
  • editing bin/pip and bin/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屋!

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