Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an executable file for Linux machine using Pyinstaller?

I have written a small GUI Desktop application using python on Ubuntu 14.04(64-bit). I wanted an executable version of my code so it can run on other linux machines. I was able to create executable for Windows and Mac. But on Linux the created binary file does not work.

For windows: the command i used to make the code executable was

pyinstaller -D -F -n main -w "main.py"

this worked fine on other windows(64-bit) machine too.

For mac:

pyinstaller --windowed "main.py"

Worked fine.

for linux: i tried

pyinstaller main.py

as well as

pyinstaller -D -F -n main -w "main.py"

im unable to open the binary file this is displayed when i open the executable

i tried changing the permissions using chmod, still the same error.

I am using:

  • python 2.7 - 64bit
  • pyinstaller 2.1
  • Tkinter
like image 813
arvindh Avatar asked Jul 07 '15 04:07

arvindh


2 Answers

I tried in my Ubuntu:

pyinstaller -D -F -n main -c "main.py"

and it created a working binary.

like image 142
Drimades Boy Avatar answered Sep 23 '22 18:09

Drimades Boy


pyinstaller 2.1 was the problem. Installing dev version of pyinstaller(version 2.1.1dev-) worked.

like image 39
arvindh Avatar answered Sep 21 '22 18:09

arvindh