

Anyway, there are probably some data files around and if you're running a site-based app then your program depends on HTML, JavaScript, and CSS files too. Using PyInstaller, I found a better method using shortcut to the. If you don't want to require the end user to install Python, you can distribute the application along with the embeddable Python package. However, it is relatively easy to make a Windows executable that should work as long as the user has python3.dll in the path. pyzw file should be executable, in Unix because it gets marked as such and in Windows because Python installation usually registers those extensions. Where interpreter can be something like /usr/bin/env python (see Specifying the Interpreter). $ python -m zipapp -p "interpreter" myapp pyz than can be directly executed as python myapp.pyz, but you can also make a self-contained package from a requirements.txt file: $ python -m pip install -r requirements.txt -target myapp Its basic usage is just compressing a bunch of Python files into a zip file with extension. Since it seems to be missing from the current list of answers, I think it is worth mentioning that the standard library includes a zipapp module that can be used for this purpose. So, I think that, at least for python 2.7, a better and simpler option is PyInstaller. I had only one problem using PyInstaller and multiprocessing package that was solved by using this recipe. You can create a single file, among other options ( ). bat file with the following lines for example (pyinstaller.exe must be in in the Windows path): pyinstaller.exe -onefile M圜ode.py In my opinion, it is much better because: This last reason made me try PyInstaller. I was not able to make it work together with PyQt. I have had problems with dependencies that you have to solve by importing packages in the setup file It is necessary to create a setup.py file for it to work. It has shown some problems for creating single files in Windows 64 bits: Using bundle_files = 1 with py2exe is not working I have used py2exe and it works, but I had some problems. I would like to compile some useful information about creating standalone files on Windows using Python 2.7.
