问题
I am working with Scrapy framework to scrap out data from website, but getting the following error in command prompt:
ImportError: cannot import name '_win32stdio'
Traceback is attached as a screenshot.
Kindly revert if require directory structure of my program's directory.
回答1:
Scrapy can work with Python 3 on windows if you make some minor adjustments:
Copy the _win32stdio and _pollingfile to the appropriate directory under site-packages. Namely, twisted-dir\internet. Download these from https://github.com/twisted/twisted/tree/trunk/twisted/internet
pip install pypiwin32
Granted, this is based on my personal experience. Because the repository will certainly change in the future, readers should beware the age of this answer.
Update: the twisted-win package is no longer required because the appropriate files are now included in the twisted package.
回答2:
I have gone through the same. I have resolved by updating the twisted package
pip install --upgrade twisted
or pip uninstall twisted and pip install twisted
回答3:
get whl of twisted (from below link) according to your os and py version and you are good to go! https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
来源:https://stackoverflow.com/questions/37342603/importerror-cannot-import-name-win32stdio