2016-04-09 50 views
1
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 crawl dmoz我得到這個錯誤:在python3.x上啓動scrapy項目時發生了一些錯誤

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

我們可以看到代碼嗎? – mwm314

回答

1

我也遇見了這個問題,我是這樣解決的: PIP安裝--upgrade scrapy

+0

請用英語回答。 Stackoverflow是一個全球網絡。 –

1

直到現在scrapy沒在Windows上不支持Python 3,而是在Linux上。我必須在Ubuntu上運行scrapy