简体   繁体   English

pyinstaller raspberry pi 编译,如何从命令行执行程序

[英]pyinstaller raspberry pi compiling, how to execute program from command line

This executable generation is on raspbian linux, on my raspberry-pi:此可执行文件生成在 raspbian linux 上,在我的 raspberry-pi 上:

Install pyinstaller: (I had to try this several times, as I got the error "http.client.RemoteDisconnected: Remote end closed connection without response" but it suddenly worked):安装pyinstaller:(我不得不尝试几次,因为我收到错误“http.client.RemoteDisconnected:远程结束关闭连接没有响应”但它突然起作用了):

$ pip3 install pyinstaller $ pip3 安装 pyinstaller

In directory with my tiny_test.py file:在包含我的 tiny_test.py 文件的目录中:

$ pyinstaller -F tiny_test.py $ pyinstaller -F tiny_test.py

Then, in the created dist folder, I tried to run the compiled executable: $ tiny_test然后,在创建的 dist 文件夹中,我尝试运行编译后的可执行文件:$ tiny_test

This gave the error:这给出了错误:

"tiny_test: tiny_test: cannot execute binary file" “tiny_test:tiny_test:无法执行二进制文件”

short answer:简短的回答:

$./tiny_test $./tiny_test

long anser:长答案:

Check the executable file properties:检查可执行文件属性:

$ file tiny_test $ 文件小测试

"tiny_test: 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]=ad32521ad141d04ca4fc066798301621367c7964, stripped" “tiny_test:ELF 32 位 LSB 可执行文件,ARM,EABI5 版本 1 (SYSV),动态链接,解释器 /lib/ld-linux-armhf.so.3,适用于 GNU/Linux 3.2.0,BuildID[sha1]=ad32521ad141d04ca4fc066779840167c ,剥离”

LSB executable files need to be run like this: LSB 可执行文件需要像这样运行:

$./tiny_test $./tiny_test

This worked for me!这对我有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM