即使在使用Python 2.7.12的CentOS 5.7服務器上運行python ez_setup.py --insecure
,我也得到了同樣的錯誤。即使我找不到錯誤的根本原因,我也能解決它。 ez_setup.py支持以下命令行參數:
# python ez_setup.py --help
Usage: ez_setup.py [options]
Options:
-h, --help show this help message and exit
--user install in user site package
--download-base=URL alternative URL from where to download the setuptools
package
--insecure Use internal, non-validating downloader
--version=VERSION Specify which version to download
--to-dir=TO_DIR Directory to save (and re-use) package
我知道我想安裝的版本,並指定它的命令行:
# python ez_setup.py --insecure --version=25.2.0
Downloading https://pypi.io/packages/source/s/setuptools/setuptools-25.2.0.zip
...
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
下載還是失敗了,但它打印出來下載URL。接下來使用wget
或curl
下載軟件包,並使用--to-dir
命令行參數運行安裝腳本。
# wget --insecure https://pypi.io/packages/source/s/setuptools/setuptools-25.2.0.zip
# python ez_setup.py --insecure --version=25.2.0 --to-dir=.
Setuptools現在應該已經安裝。
完整的ssl錯誤如下所示:urllib2.URLError: –
gary
請使用「編輯」將錯誤包含到問題中。 – MSeifert
我也得到同樣的錯誤,但在紅帽 –