I’ve created a program using Python on Windows. How do you turn it into Linux executable? To be specific Linux Ubuntu 9.10.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Tendou,
Since I usually develop on a Linux machine, when I need a windows version I often use cx_freeze to make windows binaries, but I also used it to make Linux binaries and it works pretty well (it is multiplatform, something py2exe is not). Like Eli said above, it doesn’t really compile, but just bundles the interpreter, byte compiled code and needed libraries into an executable, but you’ll get what you want (running on a machine without python pre-installed).
After having installed cx_freeze on a Linux machine, you can try it out with something simple, like this dummy code, which i saved as test.py:
Then run cxfreeze to make the binary. The output will look like this:
Note that with bigger projects you might get “Missing modules” errors. If you are sure they are installed, you can manually point them to cx_freeze using the –include-modules switch. See cxfreeze –help for the full help.
You can also make a setup.py file which makes “cxfreezing” resemble the way we usually install python packages, instead of doing it directly from the command line. This article even does that for a wxPython project, which might be similar to yours:
A cx_Freeze Tutorial – Build a Binary Series!