我按照https://docs.scrapy.org/en/latest/intro/install.html上的安装指南 但是我的安装失败。当我点击安装scrapy时,它最终无法安装。
------编辑于11:47 --- 我不能正确地运行scrapy。
---我跑的时候----
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 7, in <module>
from scrapy.cmdline import execute
File "/usr/local/lib/python2.7/dist-packages/scrapy/cmdline.py", line 9,
in <module>
from scrapy.crawler import CrawlerProcess
File "/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py", line 7,
in <module>
from twisted.internet import reactor, defer
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/reactor.py",
line 38, in <module>
from twisted.internet import default
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py",
line 56, in <module>
install = _getInstallFunction(platform)
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py",
line 44, in _getInstallFunction
from twisted.internet.epollreactor import install
File "/usr/local/lib/python2.7/dist-
packages/twisted/internet/epollreactor.py", line 24, in <module>
from twisted.internet import posixbase
File "/usr/local/lib/python2.7/dist-
packages/twisted/internet/posixbase.py", line 18, in <module>
from twisted.internet import error, udp, tcp
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py",
line 28, in <module>
from twisted.internet._newtls import (
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_newtls.py",
line 21, in <module>
from twisted.protocols.tls import TLSMemoryBIOFactory,
TLSMemoryBIOProtocol
File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/tls.py",
line 63, in <module>
from twisted.internet._sslverify import _setAcceptableProtocols
File "/usr/local/lib/python2.7/dist-
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'
答案 0 :(得分:1)
而不是pip install Scrapy
,请sudo pip install Scrapy
或者,使用virtualenv
答案 1 :(得分:1)
似乎是PyOpenSSL问题。
尝试:
sudo pip install -U pyOpenSSL