2017-10-17 50 views
0

我是Python新手,一般編碼。我正試圖通過Scrapy構建一個刮板。我正試圖在Mac OS 10.12.6上做到這一點。我儘可能按照說明操作(https://doc.scrapy.org/en/latest/intro/tutorial.html),但是當我撥打 scrapy start項目教程我在下面得到以下輸出。解決這個問題並理解未來錯誤消息的最好方法是什麼?scrapy startproject教程錯誤Mac OS

謝謝!

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' 
+0

請在[編輯]中顯示您的代碼。 – LW001

回答

0

我通過更新pyOpenSSL 0.14修復了這個問題。

不久後,雖然我有更多的本地和用戶版本的python問題,但通過下載Anaconda進行排序。