pyinstaller executable doesn't run in Ubuntu 18.04.1

落花浮王杯 提交于 2021-02-20 02:54:46

问题


I looked through other posts and they didn't seem to address the specific issue where nothing happens when I try to execute a compiled program.

Not sure if this is an Ubuntu issue or a python issue... Either way I'm very new to both so I'm sure there's some simple answer to this.

I wrote a simple program

print("hello")
input("now")

and used pyinstaller to compile it into a single file.

pyninstaller --onefile test.py When I try to run the file by double clicking it in the GUInothing at all happens - no error, no console. I checked properties and it is tagged as executable.

I did an ls first to make sure I was in the correct directory when I tried to run it

eric@eric-linux:~/PycharmProjects/helloworld/dist$ ls
mytest  test

To run it I entered

eric@eric-linux:~/PycharmProjects/helloworld/dist$mytest

and got the error:

Command 'mytest' not found, did you mean:


command 'mtest' from deb parmetis-test

command 'pytest' from deb python-pytest

I also tried compiling with --debug and again got the same result when I ran it. Is there something separate I have to do in Ubuntu to run an executable?


回答1:


Try running it like this: ./mytest

Bash only looks is the current directory if you specify the relative path to the file.



来源:https://stackoverflow.com/questions/53346803/pyinstaller-executable-doesnt-run-in-ubuntu-18-04-1

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