scrapy startproject tutorial错误Mac OS

时间:2017-10-17 15:46:57

标签: python-2.7 web-scraping scrapy

我是Python和编码的新手。我正在尝试通过Scrapy构建一个刮刀。我试图在Mac OS 10.12.6上这样做。我尽可能地遵循了指示(https://doc.scrapy.org/en/latest/intro/tutorial.html),但是当我打电话时 scrapy startproject tutorial 我在下面得到以下输出。解决这个问题并了解未来错误信息的最佳方法是什么?

谢谢!

File "/usr/local/bin/scrapy", line 9, in <module>
    load_entry_point('Scrapy==1.4.0', 'console_scripts', 'scrapy')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Python/2.7/site-packages/Scrapy-1.4.0-py2.7.egg/scrapy/cmdline.py", line 9, in <module>
    from scrapy.crawler import CrawlerProcess
  File "/Library/Python/2.7/site-packages/Scrapy-1.4.0-py2.7.egg/scrapy/crawler.py", line 7, in <module>
    from twisted.internet import reactor, defer
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/reactor.py", line 38, in <module>
    from twisted.internet import default
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/default.py", line 56, in <module>
    install = _getInstallFunction(platform)
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/default.py", line 50, in _getInstallFunction
    from twisted.internet.selectreactor import install
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/selectreactor.py", line 18, in <module>
    from twisted.internet import posixbase
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/posixbase.py", line 18, in <module>
    from twisted.internet import error, udp, tcp
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/tcp.py", line 28, in <module>
    from twisted.internet._newtls import (
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/internet/_newtls.py", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/twisted/protocols/tls.py", line 63, in <module>
    from twisted.internet._sslverify import _setAcceptableProtocols
  File "/Library/Python/2.7/site-packages/Twisted-17.9.0-py2.7-macosx-10.12-intel.egg/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'

1 个答案:

答案 0 :(得分:1)

我通过更新到pyOpenSSL 0.14来解决这个问题。

不久之后我对本地和用户版本的python遇到了更多问题,但是通过下载Anaconda对此进行了排序。