Installing the pypiwin32 module

这一生的挚爱 提交于 2019-12-07 18:02:02

问题


I get this error when I run a program:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-10-b045b37982bc> in <module>()
      4 #speech recognition
      5 import speech_recognition as sr
----> 6 import win32com.client
      7 import comtypes.client
      8 #speech synthesis

ModuleNotFoundError: No module named 'win32com'

---------------------------------------------------

When I tried to install the pypiwin32 module, I got this error:

 Collecting pypiwin32
  Using cached pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
  Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32)

回答1:


The problem is that pypiwin32 depends on pywin32, and, as the README says:

Note that PIP support is experimental.

Even if pip installs pywin32, you still have to manually run the post-install script with elevated privileges. So, rather than debugging why the experimental pip support isn't working for you, it's probably better to manually download the appropriate installer from the Releases page and run it.

Once that completes, pip should know that you now have pywin32 version 223 installed, so pip install pypiwin32 should hopefully work.

You might want to look through the pywin32 issues to see if anyone has reported this problem (it may only be mentioned in some issue about completing pip support, not a separate one) and, if not, file a bug report. That way, the next time someone wants to use pypiwin32, they may not even need this answer. (Since Mark Hammond, the main author of pywin32, is also listed as a maintainer of pypiwin32, I'm guessing he already knows about it—but it can't hurt to check.)



来源:https://stackoverflow.com/questions/49307303/installing-the-pypiwin32-module

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