导入错误:没有名为 pywin32 的模块

导入错误:没有名为 pywin32 的模块

问题描述:

我都试过了

pip install pypiwin32

pip install pywin32

并且它们都在我的 Windows 7 x64/Python 2.7.15 64 位上成功(这是我在 PC 上安装的唯一 Python).我什至做到了:

and they both succeeded on my Windows 7 x64 / Python 2.7.15 64-bit (it's the only Python I have installed on my PC). I even did:

python C:\Python27\Scripts\pywin32_postinstall.py -install

它成功返回:

...
创建文档的快捷方式
pywin32 扩展已成功安装.

...
Shortcut to documentation created
The pywin32 extensions were successfully installed.

我仍然明白,在执行 import pywin32 时:

Still I get, when doing import pywin32:

导入错误:没有名为 pywin32 的模块

ImportError: No module named pywin32

如何在 Windows 7 上安装 pywin32?

解决方案确实是

import win32api

而不是import pywin32