How to make python program standalone executable under linux
I have done some research but I am not looking for a way to make a script and run the .py file like answered in this question. What do I use on linux to make a python program executable
I am looking to "complie" the .py to a standalone program so users in a linux environment like ubuntu can run it out of the box without installing python and the libraries I used because no root access. I found py2exe for windows. I would think there is a way to achieve this in linux?
-
See: stackoverflow.com/q/1957054/6145303arewm– arewm2017年10月26日 18:40:40 +00:00Commented Oct 26, 2017 at 18:40
-
Possible duplicate of: stackoverflow.com/a/5458250/538418Trevor– Trevor2018年01月22日 16:56:09 +00:00Commented Jan 22, 2018 at 16:56
2 Answers 2
Doesn't pyinstaller compile under the OS you are using?
if you want a windows exe - use pyinstaller in windows environment...
For Linux, use pyinstaller in Linux.
Comments
You can use Jython to compile it to JVM. Using the Jython compiler
jythonc [options] [module]*
This would, however, require Java to be installed...
There are also a couple of other resources to compile Python. From Compiling Python Code, some cross-platform tools are
- Gordon McMillan’s installer (cross-platform)
- Anthony Tuininga’s cx_Freeze (cross-platform)
but I do not know anything about those.