pip安装遇到的问题

2 投票
1 回答
1167 浏览
提问于 2025-04-17 10:26

这是我的requirements.txt文件

  1 BeautifulSoup==3.2.0
  2 -e git://github.com/django/django@f92c9bd5eb272d537051c114bf57ed3aec132b48#egg=Django-dev

当我运行 sudo pip install --upgrade -r requirements.txt 时出现了一个错误

Obtaining Django from git+git://github.com/django/django@f92c9bd5eb272d537051c114bf57ed3aec132b48#egg=Django-dev (from -r requirements.txt (line 2))
Command /usr/local/bin/git config remote.origin.url failed with error code 1
Storing complete log in /Users/nai/.pip/pip.log`

我正在使用Git 1.7.8.3。

我通过 mkvirtualenv --no-site-packages <name> 创建了我的虚拟环境。

我使用的是Mac OS X Lion。

我看过这个 链接,但我不太确定我应该采取哪些步骤来解决这个问题?

1 个回答

2

在你提到的那个讨论串里,有个解决办法:把pip/vcs/git.py文件中的第114到118行改成下面这样:

def get_url(self, location):                                                                                          
url = call_subprocess(                                                                                                                                      
    [self.cmd, 'config', 'remote.origin.url'],                                                                                                              
    show_stdout=False, cwd=location, raise_on_returncode=False)                                                                                             
return (url or '').strip()

撰写回答