Cannot import '_win32stdio' (but pywin32 is already installed)
See original GitHub issueI am using Python 3.5.1 (64 bit), Windows 10, VS 2015 Update 2. lxml (3.6.0) and pywin32 (220.1) are installed. Scrapy (1.1.0) was installed successfully. Then, when I run an example from ‘http://doc.scrapy.org/en/latest/intro/overview.html’ in my virtual environment, I get the following exception:
(env) D:\Projects\tscrapy> scrapy runspider stackoverflow_spider.py -o top-stackoverflow-questions.json
2016-05-19 17:36:00 [scrapy] INFO: Scrapy 1.1.0 started (bot: scrapybot)
2016-05-19 17:36:00 [scrapy] INFO: Overridden settings: {'FEED_URI': 'top-stackoverflow-questions.json', 'FEED_FORMAT': 'json'}
2016-05-19 17:36:00 [scrapy] INFO: Enabled extensions:
['scrapy.extensions.logstats.LogStats',
'scrapy.extensions.corestats.CoreStats',
'scrapy.extensions.feedexport.FeedExporter']
Unhandled error in Deferred:
2016-05-19 17:36:00 [twisted] CRITICAL: Unhandled error in Deferred:
Traceback (most recent call last):
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\commands\runspider.py", line 87, in run
self.crawler_process.crawl(spidercls, **opts.spargs)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 163, in crawl
return self._crawl(crawler, *args, **kwargs)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 167, in _crawl
d = crawler.crawl(*args, **kwargs)
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\defer.py", line 1274, in unwindGenerator
return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\defer.py", line 1128, in _inlineCallbacks
result = g.send(result)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 72, in crawl
self.engine = self._create_engine()
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 97, in _create_engine
return ExecutionEngine(self, lambda _: self.stop())
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\core\engine.py", line 68, in __init__
self.downloader = downloader_cls(crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\core\downloader\__init__.py", line 88, in __init__
self.middleware = DownloaderMiddlewareManager.from_crawler(crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\middleware.py", line 58, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\middleware.py", line 34, in from_settings
mwcls = load_object(clspath)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\utils\misc.py", line 44, in load_object
mod = import_module(module)
File "C:\Program Files\Python 3.5\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\downloadermiddlewares\retry.py", line 23, in <module>
from scrapy.xlib.tx import ResponseFailed
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\xlib\tx\__init__.py", line 3, in <module>
from twisted.web import client
File "d:\projects\tscrapy\env\lib\site-packages\twisted\web\client.py", line 41, in <module>
from twisted.internet.endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\endpoints.py", line 34, in <module>
from twisted.internet.stdio import StandardIO, PipeAddress
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\stdio.py", line 30, in <module>
from twisted.internet import _win32stdio
builtins.ImportError: cannot import name '_win32stdio'
2016-05-19 17:36:00 [twisted] CRITICAL:
Traceback (most recent call last):
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\defer.py", line 1128, in _inlineCallbacks
result = g.send(result)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 72, in crawl
self.engine = self._create_engine()
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\crawler.py", line 97, in _create_engine
return ExecutionEngine(self, lambda _: self.stop())
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\core\engine.py", line 68, in __init__
self.downloader = downloader_cls(crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\core\downloader\__init__.py", line 88, in __init__
self.middleware = DownloaderMiddlewareManager.from_crawler(crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\middleware.py", line 58, in from_crawler
return cls.from_settings(crawler.settings, crawler)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\middleware.py", line 34, in from_settings
mwcls = load_object(clspath)
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\utils\misc.py", line 44, in load_object
mod = import_module(module)
File "C:\Program Files\Python 3.5\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\downloadermiddlewares\retry.py", line 23, in <module>
from scrapy.xlib.tx import ResponseFailed
File "d:\projects\tscrapy\env\lib\site-packages\scrapy\xlib\tx\__init__.py", line 3, in <module>
from twisted.web import client
File "d:\projects\tscrapy\env\lib\site-packages\twisted\web\client.py", line 41, in <module>
from twisted.internet.endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\endpoints.py", line 34, in <module>
from twisted.internet.stdio import StandardIO, PipeAddress
File "d:\projects\tscrapy\env\lib\site-packages\twisted\internet\stdio.py", line 30, in <module>
from twisted.internet import _win32stdio
ImportError: cannot import name '_win32stdio'
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Problem installing pywin32 - python - Stack Overflow
I have python installed but it's not in the regular c: drive but on the d: drive . The pywin32 installer does not...
Read more >pywin32 · PyPI
A very common report is that people install pywin32, but many imports fail ... This sometimes happens in environments that come with pywin32...
Read more >How to install the win32com python library - Super User
Start a command line with admin rights. python -m pip install pywin32. C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -install The path ...
Read more >Installed pywin 32 -- still getting error -- "No module named ...
It created a whole separate installation folder, so if I run pywin from there, and try to import arcpy, it can't find the...
Read more >have pywin32 but pyinstaller wants -- more? - Google Groups
Under Windows 7 64bit, Python 3.5, I have pip installed PyInstaller and ... from win32ctypes.pywin32 import win32api ... but that's no longer the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can get scrapy to work if you copy the _win23stdio and _pollingfile from the current repository. Of course, it’s not official.
It should be working now.