0
我處於非常糟糕的境地,因爲我沒有完全理解它們的效果就跑了幾條命令。沒有任何與python相關的工作沒有sudo
我無法使用pip,無法使用pip安裝任何內容而無需爲其添加sudo前綴。我可以用sudo安裝它。 這裏有一些錯誤的痕跡
LAP-044:Downloads pratik$ pip install requests
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
這是因爲setuptools的的。所以我試圖重新安裝設置工具。我收到這個錯誤。
LAP-044:Downloads pratik$ curl https://bootstrap.pypa.io/ez_setup.py -o - | python
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12059 100 12059 0 0 12823 0 --:--:-- --:--:-- --:--:-- 12815
Traceback (most recent call last):
File "<stdin>", line 415, in <module>
File "<stdin>", line 411, in main
File "<stdin>", line 327, in download_setuptools
File "<stdin>", line 347, in _resolve_version
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
如果我用python3運行它,同樣的setuptools安裝是成功的。任何人都可以告訴我什麼是錯誤的,以及如何解決它?
你們是不是要在虛擬環境中運行'pip'?如果不是,它會嘗試安裝到機器範圍的位置,爲此您通常需要root權限。 – Chris
你也可能想檢查'哪個pip'和'哪個python'的輸出。 –
@WayneWerner:我得到/ usr/local/bin/python 和/Library/Frameworks/Python.framework/Versions/3.5/bin/pip,其中有python和哪些pip。 –