问题
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