Python pyinstaller没有raspberry pi的预定义编译器
我想将myscript.py转换为可执行文件。我正在使用raspberry pi(raspbian)和python 2.7 我发出以下命令Python pyinstaller没有raspberry pi的预定义编译器,python,raspberry-pi,raspbian,pyinstaller,Python,Raspberry Pi,Raspbian,Pyinstaller,我想将myscript.py转换为可执行文件。我正在使用raspberry pi(raspbian)和python 2.7 我发出以下命令 sudo pip install PyInstaller sudo pyinstaller myscript.py 经过一些处理后,它提供了一个错误 Fatal error: PyInstaller does not include a pre-compiled bootloader for your platform. See <http://py
sudo pip install PyInstaller
sudo pyinstaller myscript.py
经过一些处理后,它提供了一个错误
Fatal error: PyInstaller does not include a pre-compiled bootloader for your
platform. See <http://pythonhosted.org/PyInstaller/#building-the-bootloader>
for more details and instructions how to build the bootloader.
致命错误:PyInstaller没有为您的应用程序包含预编译的引导加载程序
站台。看见
有关如何构建引导加载程序的更多详细信息和说明。
我上网构建编译器,但无法理解过程。
如何解决此问题?编译引导加载程序的可疑路径对于您的平台是错误的 可以按照论坛中提到的那样做 对于RPI,您需要获得引导加载程序。。。您可以将pyinstaller克隆到rpi中 同样,在构建pyinstaller之后,更改arm平台的目录名
cd /path/to/pyinstaller/PyInstaller/bootloader
cp -R Linux-32bit Linux-32bit-arm
对于RPI,请首先克隆,然后按照我的说明进行操作
python3.5./waf distclean all
为PyInstaller提供了不正确的体系结构。你需要为ARM(树莓皮)自己建造它pip
git clone https://github.com/pyinstaller/pyinstaller
# Alternatively download the zip from https://github.com/pyinstaller/pyinstaller/releases
cd pyinstaller/bootloader
python ./waf distclean all # or python3
cd ../PyInstaller/bootloader/
ls
file Linux-32bit-arm/run
run: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=a01c65d74d7d8b483800154dcdd4a5d2aad95d5b, stripped
这里您应该看到Linux-32bit-arm
及其内部run
和run\u d
2。检查引导加载程序
git clone https://github.com/pyinstaller/pyinstaller
# Alternatively download the zip from https://github.com/pyinstaller/pyinstaller/releases
cd pyinstaller/bootloader
python ./waf distclean all # or python3
cd ../PyInstaller/bootloader/
ls
file Linux-32bit-arm/run
run: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=a01c65d74d7d8b483800154dcdd4a5d2aad95d5b, stripped
如果你看到了上面的内容,那么到目前为止,你表现得很好。但是,如果您看到像“英特尔80386”这样的ELF 32位LSB可执行文件,那就错了
3。复制引导加载程序
git clone https://github.com/pyinstaller/pyinstaller
# Alternatively download the zip from https://github.com/pyinstaller/pyinstaller/releases
cd pyinstaller/bootloader
python ./waf distclean all # or python3
cd ../PyInstaller/bootloader/
ls
file Linux-32bit-arm/run
run: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=a01c65d74d7d8b483800154dcdd4a5d2aad95d5b, stripped
如果在venv
中安装了带有pip
的PyInstaller,请执行此操作
# Replace ${CLONED_PYINSTALLER_PATH} with the path where you git cloned above
# Replace ${PATH_TO_YOUR_PROJECT} with the path to your project (where you have the venv)
cp -r ${CLONED_PYINSTALLER_PATH}/PyInstaller/bootloader/Linux-32bit-arm ${PATH_TO_YOUR_PROJECT}/venv/lib/python3.5/site-packages/PyInstaller/bootloader/
# !!! Replace python3.5 with your version
cp -r ${CLONED_PYINSTALLER_PATH}/PyInstaller/bootloader/Linux-32bit-arm /usr/local/lib/python3.5/dist-packages/PyInstaller/bootloader
如果安装了apt get,请执行此操作
# Replace ${CLONED_PYINSTALLER_PATH} with the path where you git cloned above
# Replace ${PATH_TO_YOUR_PROJECT} with the path to your project (where you have the venv)
cp -r ${CLONED_PYINSTALLER_PATH}/PyInstaller/bootloader/Linux-32bit-arm ${PATH_TO_YOUR_PROJECT}/venv/lib/python3.5/site-packages/PyInstaller/bootloader/
# !!! Replace python3.5 with your version
cp -r ${CLONED_PYINSTALLER_PATH}/PyInstaller/bootloader/Linux-32bit-arm /usr/local/lib/python3.5/dist-packages/PyInstaller/bootloader
调试
发行
SystemError: objcopy Failure: objcopy: Unable to recognise the format of the input file `$FILE`
gcc not found
检查
`file dist/$FILE`
如果不是说ELF 32位LSB可执行文件,而是说ARM[…]
,而是说Intel或x86,则PyInstaller会尝试使用不正确的引导加载程序。如果执行了上述所有步骤,请尝试将Linux-32bit-arm
重命名为Linux-32bit
。这似乎已经奏效了
发行
SystemError: objcopy Failure: objcopy: Unable to recognise the format of the input file `$FILE`
gcc not found
解决方案
sudo apt-get install build-essential
通过运行setup.py,我能够在运行Raspbian(stretch 9.4)的Raspberry Pi上安装和创建可执行文件。安装的Python版本是3.5.3
git克隆https://github.com/pyinstaller/pyinstaller
sudo python3 setup.py install
之后,只需执行
pyinstaller.py
查看以下问题:您在应用程序中的哪一点被卡住了?人们需要知道这一点。57信息:检查EXE 57信息:生成EXE,因为out00-EXE.toc不存在58信息:显示此阶段错误后,从out00-EXE.toc生成EXE