简体   繁体   中英

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

This executable generation is on raspbian linux, on my 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):

$ pip3 install pyinstaller

In directory with my tiny_test.py file:

$ pyinstaller -F tiny_test.py

Then, in the created dist folder, I tried to run the compiled executable: $ tiny_test

This gave the error:

"tiny_test: tiny_test: cannot execute binary file"

short answer:

$./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"

LSB executable files need to be run like this:

$./tiny_test

This worked for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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