[英]python pip not working on requirements.txt after OS X 10.8 macports install
Recently bought a new Mac and was setting it up for both Python and iOS development. 最近买了一台新的Mac,并为Python和iOS开发设置了它。 Python was working fine--especially pip'ing git repos with lots of requirements.txt dependencies UNTIL I installed Xcode, macports and Apple's command line tools. Python工作正常 - 特别是pip'ing git repos有很多要求.txt依赖关系UNTIL我安装了Xcode,macports和Apple的命令行工具。
Now pip works fine for individual install (eg, pip install twilio), but whenever I run pip against a requirements.txt file it fails (with or without sudo): 现在pip适用于单独安装(例如,pip install twilio),但每当我对一个requirements.txt文件运行pip时它都会失败(有或没有sudo):
pip install ./requirements.txt
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 225, in run
InstallRequirement.from_line(name, None))
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 118, in from_line
return cls(req, comes_from, url=url)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 43, in __init__
req = pkg_resources.Requirement.parse(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2510, in parse
reqs = list(parse_requirements(s))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2436, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2404, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', './requirements.txt', 'at', '/requirements.txt')
My $PATH
value is 我的$PATH
值是
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
This looks different than the "Python pip broken after OS X 10.8 upgrade" thread. 这看起来不同于“OS X 10.8升级后破解的Python pip”线程。 I am wonder if macports created a conflict between looking in /System/Libary
and ~/Library
. 我很想知道macports在查看/System/Libary
和~/Library
之间是否存在冲突。
Any ideas? 有任何想法吗?
如果要通过需求文件安装软件包,则需要--requirement/-r
选项:
$ pip install -r requirements.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.