首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Scrapy Bench / Benchmark命令错误

Scrapy Bench / Benchmark命令错误
EN

Stack Overflow用户
提问于 2014-04-08 03:56:29
回答 2查看 553关注 0票数 6

我已经安装了Scrapy 0.22.2,并且能够运行DirBot代码示例,没有任何问题。但是,当我运行Bench命令时,我得到一些错误和异常。除了端口8998不接受连接之外,下面还有其他问题吗?

代码语言:javascript
复制
    C:\>scrapy bench
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\scrapy-0.22.2-py2.7.egg\scrapy\tests\mocks
erver.py", line 198, in <module>
    os.path.join(os.path.dirname(__file__), 'keys/cert.pem'),
  File "C:\Python27\lib\site-packages\twisted\internet\ssl.py", line 70, in __in
it__
    self.cacheContext()
  File "C:\Python27\lib\site-packages\twisted\internet\ssl.py", line 79, in cach
eContext
    ctx.use_certificate_file(self.certificateFileName)
OpenSSL.SSL.Error: [('system library', 'fopen', 'No such process'), ('BIO routin
es', 'FILE_CTRL', 'system lib'), ('SSL routines', 'SSL_CTX_use_certificate_file'
, 'system lib')]
2014-04-07 14:30:39-0500 [scrapy] INFO: Scrapy 0.22.2 started (bot: scrapybot)
2014-04-07 14:30:39-0500 [scrapy] INFO: Optional features available: ssl, http11

2014-04-07 14:30:39-0500 [scrapy] INFO: Overridden settings: {'CLOSESPIDER_TIMEO
UT': 10, 'LOG_LEVEL': 'INFO', 'LOGSTATS_INTERVAL': 1}
2014-04-07 14:30:40-0500 [scrapy] INFO: Enabled extensions: LogStats, TelnetCons
ole, CloseSpider, WebService, CoreStats, SpiderState
2014-04-07 14:30:42-0500 [scrapy] INFO: Enabled downloader middlewares: HttpAuth
Middleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, Def
aultHeadersMiddleware, MetaRefreshMiddleware, HttpCompressionMiddleware, Redirec
tMiddleware, CookiesMiddleware, ChunkedTransferMiddleware, DownloaderStats
2014-04-07 14:30:42-0500 [scrapy] INFO: Enabled spider middlewares: HttpErrorMid
dleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddlew
are
2014-04-07 14:30:42-0500 [scrapy] INFO: Enabled item pipelines:
2014-04-07 14:30:42-0500 [follow] INFO: Spider opened
2014-04-07 14:30:42-0500 [follow] INFO: Crawled 0 pages (at 0 pages/min), scrape
d 0 items (at 0 items/min)
2014-04-07 14:30:43-0500 [follow] INFO: Crawled 0 pages (at 0 pages/min), scrape
d 0 items (at 0 items/min)
2014-04-07 14:30:44-0500 [follow] INFO: Crawled 0 pages (at 0 pages/min), scrape
d 0 items (at 0 items/min)
2014-04-07 14:30:45-0500 [follow] INFO: Crawled 0 pages (at 0 pages/min), scrape
d 0 items (at 0 items/min)
2014-04-07 14:30:45-0500 [follow] ERROR: Error downloading <GET http://localhost
:8998/follow?total=100000&order=rand&maxlatency=0.0&show=20>: Connection was ref
used by other side: 10061: No connection could be made because the target machin
e actively refused it..
2014-04-07 14:30:45-0500 [follow] INFO: Closing spider (finished)
2014-04-07 14:30:45-0500 [follow] INFO: Dumping Scrapy stats:
        {'downloader/exception_count': 3,
         'downloader/exception_type_count/twisted.internet.error.ConnectionRefus
edError': 3,
         'downloader/request_bytes': 783,
         'downloader/request_count': 3,
         'downloader/request_method_count/GET': 3,
         'finish_reason': 'finished',
         'finish_time': datetime.datetime(2014, 4, 7, 19, 30, 45, 575000),
         'log_count/ERROR': 1,
         'log_count/INFO': 10,
         'scheduler/dequeued': 3,
         'scheduler/dequeued/memory': 3,
         'scheduler/enqueued': 3,
         'scheduler/enqueued/memory': 3,
         'start_time': datetime.datetime(2014, 4, 7, 19, 30, 42, 439000)}
2014-04-07 14:30:45-0500 [follow] INFO: Spider closed (finished)
EN

回答 2

Stack Overflow用户

发布于 2014-04-30 02:26:16

你需要安装Ubuntu包,但在此之前,你需要在cffi上安装ffi,即libffi-devlibffi

sudo aptitude install libffi-dev libffi

sudo pip install cffi

此外,您还需要安装libssl-dev,因为它在cryptography python包中使用。

在此之后,您应该使用以下命令重新安装scrapy:sudo pip install scrapy --upgrade

如果不能解决问题,可以从github安装最新版本的scrapy,tarball:

https://github.com/scrapy/scrapy/tarball/master

它对我很有效..

票数 0
EN

Stack Overflow用户

发布于 2019-01-14 18:38:29

如今,任何面临这样的问题的人都应该确保遵循official installation instructions

如果在遵循官方安装说明后出现这样的问题,您应该使用report it as a bug

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22921825

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档