The application cannot locate Python39.dll (126) 找不到指定的模块

The application can not locate Python39.dll (126) The specified module could not be found

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

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

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

有没有不用 pyinstaller 生成 exe 的替代方法?

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

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

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

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