【发布时间】:2018-04-14 20:24:00
【问题描述】:
试图在我新擦的 MacBookPro 上获取 pip 和其他一些实用程序。
尝试运行distribute_setup.py 失败,出现403:需要SSL;关于一些依赖:
DNS-hosting:~ User1$ sudo python distribute_setup.py
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
Traceback (most recent call last):
File "distribute_setup.py", line 485, in <module>
main(sys.argv[1:])
File "distribute_setup.py", line 480, in main
tarball = download_setuptools()
File "distribute_setup.py", line 193, in download_setuptools
src = urlopen(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: SSL is required
找到了一个应该可行的解决方法,但在其他依赖项上也失败了:(nose/tornado;我也无法安装)
DNS-hosting:~ User1$ sudo curl https://bootstrap.pypa.io/get-pip.py | python
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1622k 100 1622k 0 0 1071k 0 0:00:01 0:00:01 --:--:-- 1071k
Requirement already up-to-date: pip in /var/folders/r7/80znqn9d7jv6qf1wfbxcd_kw0000gn/T/tmpKFvgml/pip.zip (10.0.0)
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
【问题讨论】:
-
有一个解决方案说卸载/重新安装easy_install。所以现在我也无法在我的 Mac 上重新安装它。
-
自 2017 年 10 月以来,pip install 已更改并需要 SSL。因此,在该日期之前安装它的任何参考都是无效的。简单的命令如:
标签: python pip nose easy-install