在mac上安装scrapy成功,但运行错误

时间:2017-02-14 12:07:36

标签: python macos scrapy

gaoyaqiu:git gaoyaqiu$ scrapy 
Traceback (most recent call last):
  File /usr/local/bin/scrapy, line 7, in <module>
      from scrapy.cmdline import execute
  File /Library/Python/2.7/site-packages/scrapy/cmdline.py, line 9, in <module>
      from scrapy.crawler import CrawlerProcess
  File /Library/Python/2.7/site-packages/scrapy/crawler.py, line 7, in <module>
      from twisted.internet import reactor, defer
  File /Library/Python/2.7/site-packages/twisted/internet/reactor.py, line 38, in <module>
      from twisted.internet import default
  File /Library/Python/2.7/site-packages/twisted/internet/default.py, line 56, in <module>
      install = _getInstallFunction(platform)
  File /Library/Python/2.7/site-packages/twisted/internet/default.py, line 50, in _getInstallFunction
      from twisted.internet.selectreactor import install
  File /Library/Python/2.7/site-packages/twisted/internet/selectreactor.py, line 18, in <module>
      from twisted.internet import posixbase
  File /Library/Python/2.7/site-packages/twisted/internet/posixbase.py, line 18, in <module>
      from twisted.internet import error, udp, tcp
  File /Library/Python/2.7/site-packages/twisted/internet/tcp.py, line 28, in <module>
      from twisted.internet._newtls import (
  File /Library/Python/2.7/site-packages/twisted/internet/_newtls.py, line 21,  in <module>
      from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File /Library/Python/2.7/site-packages/twisted/protocols/tls.py, line 63, in  <module>
      from twisted.internet._sslverify import _setAcceptableProtocols
  File /Library/Python/2.7/site-packages/twisted/internet/_sslverify.py, line 38, in <module>
      TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1,
AttributeError: module object has no attribute OP_NO_TLSv1_1

2 个答案:

答案 0 :(得分:4)

我遇到了同样的问题。

以下帖子有帮助。

pip install Twisted==16.4.1
  

如果您需要sudo访问权限,请将其添加到您的命令中。

https://github.com/scrapy/scrapy/issues/2473

答案 1 :(得分:3)

实际上它是通过以下方式解决的:

 pip install pyopenssl --upgrade

来自链接:scrapy: 'module' object has no attribute 'OP_SINGLE_ECDH_USE'