from distutils.core import setup
import py2exe, sys, os
sys.argv.append(\'py2exe\')
setup(
options = {\'py2exe\': {\'bundle_files\': 1}},
windows = [{\'script\
If you can restrict your code, then Shed Skin, PyPy, or Cython make true, fast executables.
Py2exe, PyInstaller, or bbfreeze can package Python up to 2.7 into single executables.
Cx_Freeze packages Python up to 3.x into an executable plus many other files.
I don't know your py2exe tool, but we usually use this way to convert py to exe:
Download and install Standard Python Software: http://www.python.org/download/
Download PyInstaller via link below: http://pyinstaller.python-hosting.com/
Unpack the archive, that you have downloaded! In this examople, the directory of the unpacked files:
In the <UNPACKED_FILES_DIR>
directory, run Configure.py.
It must be run before trying to build anything.
Create a spec file for your project:
python Makespec.py -F -p <PYTHON_LIB_PATH> <PYTHON_SCRIPT>
-F: Produce a single file deployment.
-p <PYTHON_LIB_PATH>: Set base path for import (like using PYTHONPATH).
( e.g.: C:\Program Files\Python24\Lib\ )
<PYTHON_SCRIPT>: Path to python script.
6 Build your project!
python Build.py <SPECFILE>
<SPECFILE>: Path to the specfile, that have been created in step 4!
The full path to <SPECFILE>:
<UNPACKED_FILES_DIR>/<PYTHON_SCRIPT>/<PYTHON_SCRIPT>.spec
<SPECFILE>
.Yes. Are you making a windowing application or a console application? See the example setup.py files that came with py2exe.