2
我第一次嘗試使用pyinstaller
。我創建了一個名爲hello.py
只用一行代碼文件:無法在Linux上運行Pyinstaller可執行文件
print "hello"
我用下面的命令來使一個二進制:
pyinstaller hello.py
過程成功完成,二進制在dist/hello
創建。我無法運行這個二進制文件。當我試圖從終端運行它,我得到了,
bash: .: hello: cannot execute binary file
我試圖從一倍點擊nautilus
,但什麼也沒有發生。 如何運行這個二進制文件?
我使用Ubuntu 16.04
鍵入相對路徑
dist/hello
什麼是命令'文件/路徑/到/ yourexecutable/hello'的輸出運行? – Locoluis此外,您需要整個'dist/hello'文件夾,而不僅僅是可執行文件。 – Locoluis
@Locoluis,我從dist文件夾本身運行文件。對於GNU/Linux 2.6.32,輸出是'hello:ELF 64位LSB可執行文件,x86-64,版本1(SYSV),動態鏈接的解釋器/lib64/ld-linux-x86-64.so.2, BuildID [sha1] = 373ec5dee826653796e927ac3d65c9a8ec7db9da,剝離 –