AttributeError:'模块'对象没有属性' OP_NO_TLSv1_1'在virtualenv

时间:2017-11-21 07:23:08

标签: python macos scrapy

我尝试在OSX上的虚拟环境中安装scrapy并遇到:

  

回溯(最近一次呼叫最后一次):文件" / usr / local / bin / scrapy",   7号线,在       来自scrapy.cmdline import执行File" /Library/Python/2.7/site-packages/scrapy/cmdline.py" ;,第9行,in          来自scrapy.crawler import CrawlerProcess File" /Library/Python/2.7/site-packages/scrapy/crawler.py" ;,第7行,in          来自twisted.internet import reactor,defer File" /Library/Python/2.7/site-packages/twisted/internet/reactor.py" ;, line   38,在       来自twisted.internet import default File" /Library/Python/2.7/site-packages/twisted/internet/default.py" ;, line   56,在       install = _getInstallFunction(platform)File" /Library/Python/2.7/site-packages/twisted/internet/default.py" ;, line   50,在_getInstallFunction中       来自twisted.internet.selectreactor import install File" /Library/Python/2.7/site-packages/twisted/internet/selectreactor.py",   第18行,在       来自twisted.internet import posixbase File" /Library/Python/2.7/site-packages/twisted/internet/posixbase.py",   第18行,在       来自twisted.internet import error,udp,tcp File" /Library/Python/2.7/site-packages/twisted/internet/tcp.py" ;,第28行,   在       来自twisted.internet._newtls import(File" /Library/Python/2.7/site-packages/twisted/internet/_newtls.py" ;, line   21,在       来自twisted.protocols.tls导入TLSMemoryBIOFactory,TLSMemoryBIOProtocol文件   " /Library/Python/2.7/site-packages/twisted/protocols/tls.py" ;,第63行,   在       来自twisted.internet._sslverify import _setAcceptableProtocols文件   " /Library/Python/2.7/site-packages/twisted/internet/_sslverify.py" ;,   第38行,在       TLSVersion.TLSv1_1:SSL.OP_NO_TLSv1_1,属性错误:'模块'对象没有属性' OP_NO_TLSv1_1'

我试过这些:

  1. pip install Twisted==16.4.1

  2. pip install --upgrade pyOpenSSl

  3. 但仍然得到AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'

    我的python版本是2.7.10

    试过这些并且所有人都已经及时了解要求:......":

    pip install --upgrade scrapy
    pip install --upgrade twisted
    pip install --upgrade pyopenssl
    

    希望能够解决这个问题....谢谢!

0 个答案:

没有答案