简体   繁体   English

如何解决“ ImportError:无法导入名称'_win32stdio'”? 障碍中的典型解决方案

[英]How to fix “ImportError: cannot import name '_win32stdio'”? Typical solutions at a roadblock

I am trying to overcome a seemingly answered question, but none of the provided solutions are enough. 我试图克服一个看似已回答的问题,但是所提供的解决方案都不够。

Specifically, I am trying to create a ScraPy crawler, but when I use "scrapy crawl myProjectsName" , I get: 具体来说,我尝试创建一个ScraPy搜寻器,但是当我使用"scrapy crawl myProjectsName" ,我得到:

ImportError: cannot import name '_win32stdio'

Now, that would be fine, given that the question already has a solution posted here on stackoverflow: 现在,考虑到问题已经在stackoverflow上发布了解决方案,那就很好了:

ImportError : cannot import name '_win32stdio' (Link to previous solution) ImportError:无法导入名称“ _win32stdio” (链接到先前的解决方案)

But it's not working out for me: 但这对我不起作用:

When I write "pip install twisted" or the alternative solution (seen elsewhere on the web), "pip install pywin32" , both result in the following error msg from my terminal: 当我编写"pip install twisted"或其他解决方案(在网络上的其他地方看到) "pip install pywin32" ,两者均从我的终端导致以下错误消息:

Requirement already satisfied: twisted in c:\users\roland\anaconda3\lib\site-packages (16.3.1)
Requirement already satisfied: zope.interface>=4.0.2 in c:\users\roland\anaconda3\lib\site-packages (from twisted) (4.2.0)

Here is a link to some (but not all -- it was very long...) of the traceback shown in terminal 这是到终端中显示的某些追溯的链接(但不是全部-很长...)

https://imgur.com/LfhXBkK https://imgur.com/LfhXBkK

My expected result is a functional output from my scrapy web crawler. 我的预期结果是我的爬网爬虫的功能输出。 But the output is an ImportError. 但是输出是ImportError。

I believe the solution is probably as simple as copy and pasting something from here to there, since the contents appear to already be on my computer. 我相信解决方案可能很简单,就是从这里复制并粘贴一些东西,因为其中的内容似乎已经在我的计算机上了。 I just don't know where to put them. 我只是不知道将它们放在哪里。

Note/PS: I presume I could sort this out on my own if I knew how to read the traceback info, is that right? 注意/ PS:如果我知道如何读取回溯信息,我想我可以自己解决这个问题,对吗? If you've figured out a solution to my issue, how did you know what it was? 如果您想出解决我问题的方法,您怎么知道它是什么?

The solution was to download twisted-win from github: https://github.com/twisted/twisted 解决方案是从github下载twisted-win: https : //github.com/twisted/twisted

Then copy _win32stdio and _pollingfile to the directory where it was missing. 然后将_win32stdio和_pollingfile复制到丢失的目录中。

Now it works! 现在可以了!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “如何修复‘导入错误:无法导入名称‘SQLAlchemy’ - "How to fix' ImportError: cannot import name 'SQLAlchemy' 如何解决“ ImportError:无法导入名称'printmsg'” - How can I fix “ImportError: cannot import name 'printmsg'” 如何修复 ImportError:无法从“Test”导入名称“testMethod” - How to fix ImportError: cannot import name 'testMethod' from 'Test' 如何修复“ImportError: cannot import name '_raise_dep_warning_if_not_pytest' from 'sklearn.utils.deprecation'”? - How to fix “ImportError: cannot import name '_raise_dep_warning_if_not_pytest' from 'sklearn.utils.deprecation'”? 在Python中从Cleverhans.compat导入标志时,如何解决“ ImportError:无法导入名称'flags'” - How to fix “ImportError: cannot import name 'flags' ” while importing flags from Cleverhans.compat in Python 使用statsmodels时如何解决此错误“ ImportError:无法导入名称'factorial'”? - How to fix this error while using statsmodels“ ImportError: cannot import name 'factorial'”? 如何修复ImportError:无法导入名称'swapaxes'|| 无法初始化sys标准流 - how to fix ImportError: cannot import name 'swapaxes' || can't initialize sys standard streams 如何修复ImportError:无法从Dally中在Dash中导入名称'Event'(Python)? - How to fix ImportError: cannot import name 'Event' in Dash from plotly (python)? 如何修复 ImportError: cannot import name 'HTMLParseError' from 'html.parser'? - How to fix the ImportError: cannot import name 'HTMLParseError' from 'html.parser'? ImportError:无法导入名称“类型” - ImportError: cannot import name 'types'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM