ImportError : cannot import name '_win32stdio'

别来无恙 提交于 2019-12-20 15:07:49

问题


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:

  1. 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

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!