I'm building a Python application and don't want to force my clients to install Python and modules. I also want to make my application closed-source.
So, is there a way to compile Python scripts to standalone executables?
I'm building a Python application and don't want to force my clients to install Python and modules. I also want to make my application closed-source.
So, is there a way to compile Python scripts to standalone executables?
I also recommend pyinstaller for better backward compatibility such as python 2.3 - 2.7.
for py2exe, you have to have python 2.6
py2exe will make the exe file you want but you need to have the same version of MSVCR90.dll on the machine you're going to use your new exe. See http://www.py2exe.org/index.cgi/Tutorial for more info.
I'm told that PyRun, https://www.egenix.com/products/python/PyRun/, is also an option.
Use Cython to convert to c, compile and link with gcc. Another could be, make the core functions in c (the ones you want to make hard to reverse), compile them and use python boost to import the compiled code ( plus you get a much faster code execution). then use any tool mentioned to distribute.
Yes, it is possible to compile Python scripts into standalone executable.
PyInstaller can be used to convert Python programs into stand-alone executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX. It is one of the recommended converters.
py2exe converts Python scripts into only executable in Windows platform.
Cython is a static compiler for both the Python programming language and the extended Cython programming language.
I would like to compile some useful information about creating standalone files on windows using Python 2.7.
I have used py2exe and it works, but I had some problems.
It has shown some problems for creating single files in Windows 64 bits: Using bundle_files = 1 with py2exe is not working;
It is necessary to create a setup.py file for it to work. http://www.py2exe.org/index.cgi/Tutorial#Step2;
I have had problems with dependencies that you have to solve by importing packages in the setup file;
I was not able to make it work together with PyQt..
This last reason made me try PyInstaller http://www.pyinstaller.org/ .
In my opinion, it is much better because:
I suggest creating a .bat file with the following lines for example (pyinstaller.exe must be in Windows Path):
You can create a single file, among other options (https://pyinstaller.readthedocs.io/en/stable/usage.html#options).
I had only one problem using PyInstaller and multiprocessing package that was solved by using this recipe: https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing .
So, I think that, at least for python 2.7, a better and simpler option is PyInstaller.