无法安装 pywin32..?
我尝试通过 32 位 python 2.6 msi 安装程序安装 pywin32 并收到此错误:
我不知道为什么,所以我去安装了 python 2.7 并再次尝试使用 pywin32 2.7 安装程序,并收到一个错误,该错误相当于另一个错误(抱歉没有更具体,但 python 2.7 现在是该错误非常模糊,并且有“错误:”,如果我没记错的话,后面就没有更多文本了)。
但是,我无法弄清楚这个错误意味着什么。我想使用 pyinstaller,但它需要 pywin32,因此在无法安装 pywin32 后,我尝试了 py2exe 并收到此错误:
*** finding dlls needed ***
error: pywintypes26.dll: No such file or directory
所以我很确定我需要 pywin32。有人有什么想法吗?
I tried to install pywin32 via the 32 bit python 2.6 msi installer and got this error:
I have no idea why, so I went and installed python 2.7 and tried again with the pywin32 2.7 installer and got an error that amounted to another error (Sorry for not being more specific, but python 2.7 is now gone from my computer. The error was incredibly vague and had "Error:" and then no more text after it if I recall correctly).
I can't figure out what this error means, however. I wanted to use pyinstaller but it requires pywin32, so after I couldn't install pywin32 I tried py2exe and got this error:
*** finding dlls needed ***
error: pywintypes26.dll: No such file or directory
So I'm pretty sure I need pywin32. Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道原因,但我遇到了相同的错误(仅具有不同的行号,可能来自不同版本的 pywin32),并且此修复对我有用,在 Windows 7 上安装:
打开命令提示符到 SCRIPT 目录并键入:
python pywin32_postinstall.py -install
您必须已安装 Python (也许很明显)并在您的 Windows PATH 环境变量中使其起作用。您还可以尝试 PLATLIB 目录中的 testall 脚本(尽管对我来说,该脚本挂起)。完成此操作后,我就可以从 Python IDLE 导入 pywin32 模块了。
(尝试以兼容模式运行安装程序并没有为我解决这个问题。)
I don't know the cause, but I got the same error (only with different line numbers, maybe from a different version of pywin32), and this fix worked for me, installing on windows 7:
Open a command prompt to the SCRIPT directory and type:
python pywin32_postinstall.py -install
You must have Python already installed (perhaps obviously) and in your windows PATH environment variable for this to work. You can also try the testall script in that PLATLIB directory (though for me, that hung). After doing this, I was able to import pywin32 modules from the Python IDLE just fine.
(Trying to run the installer in compatibility mode didn't solve this for me.)
我做了以下工作并适用于 2.7 版本(我没有尝试 3.0 及更高版本,但它也应该可以工作):
如果你想检查它是否有效,只需执行:
import win32api
并运行它。I did the following and worked for version 2.7 (I did not try 3.0 and up, but it should work too):
If you want to check if it worked just do:
import win32api
and run it.截至我撰写本文时(2012 年 2 月),IMO Python 2.5 是 Windows 上最稳定的 Python 版本。我建议您尝试在 Python 2.5 上重新安装所有内容。我在 Windows 7 上使用它,没有任何问题
As of when I wrote this (Feb'12), IMO Python 2.5 is the most stable version of Python on Windows. I suggest you try re-installing everything on Python 2.5. I use it on Windows 7 and I don't have any issues whatsoever