Not able to run Pyinstaller executable on Linux

倾然丶 夕夏残阳落幕 提交于 2020-05-15 05:03:19

问题


I am trying out pyinstaller for the first time. I created a file named hello.py with just one line of code:

print "hello"

I used the following command to make a binary:

pyinstaller hello.py

The process completed successfully and a binary was created at dist/hello. I am not able to run this binary file. When I tried to run it from the terminal, I got,

bash: .: hello: cannot execute binary file

I tried to double click it from nautilus but nothing is happening. How can I run this binary file?

I am using Ubuntu 16.04


回答1:


Got it running by typing the relative path dist/hello in terminal




回答2:


for linux (tested on ubuntu 16.04 python3) pyinstaller hello.py --onefile it create one file named hello. Then go inside dist folder use terminal cd dist. Then ./hello. Looks not as windows way , but work. ./hello is something like , run outside...



来源:https://stackoverflow.com/questions/46178291/not-able-to-run-pyinstaller-executable-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!