Pyinstaller 缺少引导加载程序

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

我在 win10-64 上全新安装了 Python37-32 所有要求似乎都得到满足,我的 hello world python 文件正在执行

if __name__ == '__main__' :
    print("hello world")

但是当我尝试使用 pyinstaller

pyinstaller hello.py

结束时出现错误

5764 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
5764 INFO: Bootloader c:\users\xxxxxxx\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run_d.exe
5764 INFO: checking EXE
5764 INFO: Building EXE because EXE-00.toc is non existent
5779 INFO: Building EXE from EXE-00.toc

Fatal error: PyInstaller does not include a pre-compiled bootloader for your
platform. For more details and instructions how to build the bootloader see
<https://pyinstaller.readthedocs.io/en/stable/bootloader-building.html>

这是 Windows 上的基本安装,我不必手动重新编译任何引导加载程序(我习惯使用较旧的 python 版本进行 pyinstaller,并且从未遇到过问题)。 我应该去哪里解决这个问题?

编辑

该错误出现在 python37-32 中,但未出现在 python37(64 位)中

python windows pyinstaller python-3.7
3个回答
4
投票

下载 pyinstaller 并从源代码安装,而不是使用 pip。

python setup.py install

然后,如果您的系统是 64 位,则会构建 64 位引导加载程序,尽管 python37-32 需要 32 位引导加载程序。 在源代码中

cd bootloader
并按照
here
的说明运行 python ./waf all --target-arch=32bit

然后将

run.exe
从 build 文件夹复制到 pyinstaller 32bit bootloader 文件夹。

一个 issue 已在 pyinstaller github 上打开。


2
投票

首先,确保您运行的是最新版本的 Pyinstaller==3.5。 之前版本的pyinstaller不支持python3.7。

如果没问题,可能是因为 pyinstaller 安装不完整 手动检查 pyinstaller 安装的引导加载程序文件是否存在。引导加载程序(预编译)文件应该位于您的 python 安装中

c:\users\xxxxxxx\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run_d.exe

作为最后的手段,我建议通过 setup.py 安装 pyinstaller。当您运行 setup.py 时,它应该为您的机器构建引导加载程序 https://pythonhosted.org/PyInstaller/installation.html#installing-from-the-archive


0
投票

我遇到了同样的问题,我这样做了:

pip uninstall PyInstaller
pip install PyInstaller

事情是这样的:成功了!!!

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