python - 在python3.x上启动scrapy项目时出现一些错误

标签 python python-3.x scrapy twisted

python version=3.5.1

scrapy version=1.1.0 rc1

Twisted version =16.1.0(scrapy said Twisted version just need>=15.5)

我知道scrapy 1.1.0已经完全支持Python 3.x,并且我已经成功创建了一个项目。但是当我尝试启动程序时:scrapy scrapy dmoz 我收到此错误:

2016-04-09 21:15:17 [scrapy] INFO: Scrapy 1.1.0rc1 started (bot: doub)
2016-04-09 21:15:17 [scrapy] INFO: Overridden settings: {'BOT_NAME': 'doub', 'SPIDER_MODULES': ['doub.spiders'], 'NEWSPIDER_MODULE': 'doub.spiders', 'ROBOTSTXT_OBEY': True}
2016-04-09 21:15:18 [scrapy] INFO: Enabled extensions:
['scrapy.extensions.logstats.LogStats', 'scrapy.extensions.corestats.CoreStats']
Unhandled error in Deferred:
2016-04-09 21:15:18 [twisted] CRITICAL: Unhandled error in Deferred:


Traceback (most recent call last):
  File "d:\python\python35-32\lib\site-packages\scrapy\commands\crawl.py", line 57, in run
    self.crawler_process.crawl(spname, **opts.spargs)
  File "d:\python\python35-32\lib\site-packages\scrapy\crawler.py", line 152, in crawl
    return self._crawl(crawler, *args, **kwargs)
  File "d:\python\python35-32\lib\site-packages\scrapy\crawler.py", line 156, in _crawl
    d = crawler.crawl(*args, **kwargs)
  File "d:\python\python35-32\lib\site-packages\twisted\internet\defer.py", line 1274, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "d:\python\python35-32\lib\site-packages\twisted\internet\defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "d:\python\python35-32\lib\site-packages\twisted\python\failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "d:\python\python35-32\lib\site-packages\scrapy\crawler.py", line 80, in crawl
    yield exc
builtins.ImportError: cannot import name '_win32stdio'
2016-04-09 21:15:18 [twisted] CRITICAL:

最佳答案

我也遇到了这个问题,我是这样解决的: pip install --升级 scrapy

关于python - 在python3.x上启动scrapy项目时出现一些错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36517706/

相关文章:

python - PyInstaller,使模块像普通 Python 一样不可导入

python - 按第 1 列和标题行重新排列外部参照/csv

python - 在多个条件下的 For 循环中过滤 pandas DataFrame 的更快方法

Python 3 子进程比同等的 bash 慢

python - 如果未找到元素,脚本将不起作用

Python Asyncio 任务取消

Python:Scrapy start_urls 列表能够处理 .format()?

python - 横向扩展 Scrapyd

xpath - Xpath在firepath中工作,但在scrapy中工作

python - 类型错误 : unsupported operand type(s)s for +: 'StringVar' and 'str' //Create a text file