Pip Install Twisted Error 1
在Mac osx 10.9.4上的virtualenv中使用
我不知道该如何解决。 我使用了easy_install,但是我遇到了SSL验证问题。 有人有类似的问题吗? 其余的错误消息如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | Collecting twisted Using cached Twisted-16.6.0.tar.bz2 Complete output from command python setup.py egg_info: Download error on https://pypi.python.org/simple/incremental/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! Couldn't find index page for 'incremental' (maybe misspelled?) Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found! No local packages or working download links found for incremental>=16.10.1 Traceback (most recent call last): File"<string>", line 1, in <module> File"/private/var/folders/9r/3b500gbs3093ms87mqqbckr80000gn/T/pip-build-lqvxc68n/twisted/setup.py", line 21, in <module> setuptools.setup(**_setup["getSetupArgs"]()) File"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/setuptools/dist.py", line 317, in __init__ self.fetch_build_eggs(attrs['setup_requires']) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs replace_conflicting=True, File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 851, in resolve dist = best[req.key] = env.best_match(req, ws, installer) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1123, in best_match return self.obtain(req, installer) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1135, in obtain return installer(requirement) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/setuptools/dist.py", line 440, in fetch_build_egg return cmd.easy_install(req) File"/Users/Complex-Cauchy/1/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 668, in easy_install raise DistutilsError(msg) distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1') ---------------------------------------- |
运行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | CONNECTED(00000003) depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA verify error:num=20:unable to get local issuer certificate verify return:0 --- Certificate chain 0 s:/businessCategory=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=3359300/street=16 Allen Rd/postalCode=03894-4801/C=US/ST=NH/L=Wolfeboro/O=Python Software Foundation/CN=www.python.org i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA -----BEGIN CERTIFICATE----- MIIIWjCCB0KgAwIBAgIQCXCW7BLw16II/CMOsOFe/jANBgkqhkiG9w0BAQsFADB1 .. -----END CERTIFICATE----- 1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA -----BEGIN CERTIFICATE----- MIIEtjCCA56gAwIBAgIQDHmpRLCMEZUgkmFf4msdgzANBgkqhkiG9w0BAQsFADBs .... -----END CERTIFICATE----- Server certificate subject=/businessCategory=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=3359300/street=16 Allen Rd/postalCode=03894-4801/C=US/ST=NH/L=Wolfeboro/O=Python Software Foundation/CN=www.python.org issuer=/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA --- No client certificate CA names sent --- SSL handshake has read 3524 bytes and written 456 bytes --- New, TLSv1/SSLv3, Cipher is AES128-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : AES128-SHA Session-ID: BC7695FF86D2B82B20468A13E3F3E13AE23776B500E64665305EEBAF49BB54D1 Session-ID-ctx: Master-Key:8D25B34237A3C74E90317D87BA74A2AAF0E8C424FB2ADE3D72E5F234D5E043C4527641290B928B3A22 1BE7D44116CFB1 Key-Arg : None Start Time: 1487035770 Timeout : 300 (sec) Verify return code: 0 (ok) |
我在Mac OSX 10.11.6上使用全新安装的Python3.6.1在新的virtualenv中遇到了同样的问题。在我的情况下,我安装了旧版本的Twisted依赖增量,这阻止了安装。
1 2 | pip install --upgrade incremental pip install Twisted |
注意I:我从需求文件中安装了一整套软件包,其中指定了相同的增量版本。我真的很想知道为什么增量的升级有助于并且不知道究竟出了什么问题。如果有人能澄清,那就太好了。
注意II:在新安装时,在Twisted之前安装增量似乎也是必要的[使用CentOS7时经验丰富]。
注意三:问题已经传达给了惊人的Twisted社区,一旦实施了扭曲的机票#9457,在发布这个问题时我的答案应该过时了。
您报告的错误不完整。
对类似问题的调查:
- Python pip install给出了"命令"python setup.py egg_info"失败,错误代码为1"
- 由于egg_info错误,无法通过pip安装
- Python pip安装失败:命令egg_info无效
- https://github.com/donnemartin/gitsome/issues/4
表明:
- 你缺少setuptools。在virtualenv里面(你确实激活了你的virtualenv,对吗?)这似乎难以置信。
- 你缺少C工具链的一部分 - 一个编译器,一些必要的标题等.Twisted包含C扩展,所以这似乎是可能的。你有C工具链吗?
- 您正在使用不兼容的Python版本。您使用的是哪个版本的Python?
但是,您包含的其他证书验证失败错误表明它不是由任何这些引起的。相反,无法下载依赖项,因为pip无法与从中下载依赖项所需的PyPI服务器进行TLS握手。
这可能是由许多不同的事情引起的。您的系统的浏览器可以加载
1 | openssl s_client -showcerts -connect pypi.python.org:443 |
这可能会为您提供有关TLS层发生的更多详细信息。如果
FWIW我在尝试安装twis??ted时遇到同样的错误:
1 | distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1') |
在我的情况下,我不小心安装了一个古老的设置工具,弄乱了
我通过删除setuptools(
尝试升级pip包。
1 | sudo pip install --upgrade pip |
和Twisted有两个必需的依赖项:
安装C编译器
由于从源代码安装Twisted涉及编译C代码,因此在OS X或Windows上,您需要安装C编译器才能安装Twisted。
安装zope.interface
从源代码安装时,在使用Twisted之前,您还需要安装zope.interface,您可以从Twisted主页下载。
并按照您的步骤安装或按照此链接
我在MacBook上安装Twisted时遇到了类似的问题,在尝试了很多不同的方法之后,我成功地使用conda安装了Twisted。
你可以尝试使用Anaconda或miniconda。
https://conda.io/docs/download.html
https://stackoverflow.com/a/20994790/1294704