7

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

3
  • What's the output of the command file /path/to/yourexecutable/hello? Commented Sep 12, 2017 at 13:56
  • Also, you need the whole dist/hello folder, not just the executable. Commented Sep 12, 2017 at 14:03
  • @Locoluis, I am running the file from the dist folder itself. The output is hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=373ec5dee826653796e927ac3d65c9a8ec7db9da, stripped Commented Sep 12, 2017 at 14:07

2 Answers 2

8

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

Sign up to request clarification or add additional context in comments.

1 Comment

tq u bro... I was facing same problem... tq so much
3

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...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.