应用程序无法定位 Python39.dll (126) The specified module could not be found

时间:2021-05-28 22:29:56

标签: python pyinstaller pywinauto

我曾尝试使用 pysintaller 从我的 python 项目制作一个 exe,但我遇到了 错误: 应用程序找不到 Python39.dll (126) 找不到指定的模块。

起初我尝试使用已安装的 Python 3.9,然后我尝试安装 2.5 版,但我仍然收到相同的错误消息。

2020 年 12 月,Pywinauto 的 Github 上提到了这个问题,但没有适当的解决方案或可行的解决方法。 Pywinauto 中使用的 Pywin32 库似乎与 pyinstaller 不兼容。

是否有另一种方法可以在没有 pyinstaller 的情况下生成 exe?

1 个答案:

答案 0 :(得分:1)

另一种生成 exe 的方法是 Nuitka。 例如,Pywinauto 记录器是用 Nuitka 编译的。 您将在 https://github.com/beuaaa/pywinauto_recorder/tree/master/bin

中找到编译 Pywinauto 记录器的所有文件

这是允许您编译 Python 模块的命令行:

python.exe -m nuitka --standalone --mingw64 your_main.py