我用 pyinstaller 创建的 .exe 文件适用于 Windows 10,但不适用于 Windows 7

问题描述 投票:0回答:1

当我在 Windows 7 上运行程序时,出现此错误:
加载 Python DLL 'C:\Users\msi\AppData\Local\Temp_MEI91442\python38.dll 时出错
'.
没有生成错误消息。
FormatMessageW:Feil参数。 (翻译:FormatMessageW:参数错误。)
LoadLibrary:PyInstaller:FormatMessageW 失败。

该程序将视频转换为文本文件,您可以通过终端播放该文件。它使用 ffmpeg 和 ffprobe,我将它们捆绑在 .exe 文件中。 .exe 文件在 Windows 10 上运行良好。

使用 pyinstaller 转换为 .exe:
pyinstaller --onefile --console --icon="icon.ico" --add-data ffmpeg.exe;。 --添加数据 ffprobe.exe;。代码.py

有人知道如何解决这个问题吗?

python windows-7 pyinstaller
1个回答
3
投票

我也有同样的问题。

您必须使用支持应运行 .exe 的 Windows 版本系统的 Python 版本来执行 pyinstaller。
否则 pyistaller 将捆绑一个在执行选项系统上不可执行的 python 版本。

在这里您可以看到带有注释的Python版本,是否可以在win7或winXP上使用它们。
Upt do 版本 3.4.x python 支持 winXP 和 upt 至 3.8.x win7。

请考虑您的 .py 应用程序也应该能够使用较旧的 python 版本运行。

© www.soinside.com 2019 - 2024. All rights reserved.