安装 pypiwin32 模块 [英] Installing the pypiwin32 module

查看:54
本文介绍了安装 pypiwin32 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行程序时出现此错误:

---------------------------------------------------------------------------ModuleNotFoundError 追溯(最近一次调用最后一次)<ipython-input-10-b045b37982bc>在 <module>()4 #语音识别5 导入语音识别为 sr---->6 导入win32com.client7 导入 comtypes.client8 #语音合成ModuleNotFoundError: 没有名为win32com"的模块--------------------------------------------------——

当我尝试安装 pypiwin32 模块时,出现此错误:

 收集pypiwin32使用缓存的 pypiwin32-223-py3-none-any.whl收集pywin32>=223(来自pypiwin32)找不到满足要求的版本 pywin32>=223(来自 pypiwin32)(来自版本:)没有找到 pywin32>=223 的匹配分布(来自 pypiwin32)

解决方案

问题在于 pypiwin32 依赖于 pywin32,并且,正如自述文件所说:

<块引用>

请注意,PIP 支持是实验性的.

即使 pip 安装了 pywin32,您仍然需要使用提升的权限手动运行安装后脚本.因此,与其调试实验性 pip 支持为何对您不起作用,不如从 Releases 页面并运行它.

一旦完成,pip 应该知道您现在已经安装了 pywin32 版本 223,所以 pip install pypiwin32 应该可以工作.>

您可能想要查看 pywin32 问题看看是否有人报告过这个问题(它可能只在关于完成 pip 支持的某个问题中提到,而不是单独的一个),如果没有,提交错误报告.这样,下次有人想要使用 pypiwin32 时,他们甚至可能不需要这个答案.(由于 pywin32 的主要作者 Mark Hammond 也被列为 pypiwin32 的维护者,我猜他已经知道了——但它不会伤害检查.)

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)

解决方案

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

这篇关于安装 pypiwin32 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆