无法安装 pywin32..?

发布于 2025-01-04 22:33:14 字数 508 浏览 6 评论 0原文

我尝试通过 32 位 python 2.6 msi 安装程序安装 pywin32 并收到此错误:

error

我不知道为什么,所以我去安装了 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:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

淡紫姑娘! 2025-01-11 22:33:14

我不知道原因,但我遇到了相同的错误(仅具有不同的行号,可能来自不同版本的 pywin32),并且此修复对我有用,在 Windows 7 上安装:

  1. 使用以下命令将安装程序文件提取到目录免费的 7zip(或类似)程序
  2. 将 PLATLIB 目录中的所有内容复制到 C:\Python26\Lib\site-packages
  3. 打开命令提示符到 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:

  1. Extract the installer file to a directory using the free 7zip (or similar) program
  2. Copy everything in the PLATLIB directory to C:\Python26\Lib\site-packages
  3. 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.)

一直在等你来 2025-01-11 22:33:14

我做了以下工作并适用于 2.7 版本(我没有尝试 3.0 及更高版本,但它也应该可以工作):

  1. 将 .exe 文件移至 platlib (C:\Python27\Lib\site-packages)
  2. 以管理员身份运行 . exe 文件,你应该很好:)

如果你想检查它是否有效,只需执行: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):

  1. Move the .exe file into the platlib (C:\Python27\Lib\site-packages)
  2. Run as admin the .exe file and you should be Good :)

If you want to check if it worked just do: import win32api and run it.

神妖 2025-01-11 22:33:14

截至我撰写本文时(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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文