Skip to main content

Build standalone executables for Windows

Project description

py2exe for Python 3

py2exe is a software to build standalone Windows executable programs from Python scripts. py2exe can build console executables and windows (GUI) executables. py2exe supports the Python versions* included in the official development cycle.

Development of py2exe is hosted here:


The detailed changelog is published on GitHub.


  • improved the hook for pkg_resources to detect its vendored content automatically
  • the matplotlib hook now does not exclude wx automatically
  • adapted the hook for matplotlib to support their use of delvewheel
  • adapted the hooks for numpy and pandas to support the new .libs location


  • Add support for Python 3.11
  • Drop support for Python 3.7
  • Drop support for win32 wheels
  • Remove build_exe command line interface. Please use the py2exe.freeze API.


  • Support scipy versions newer than 1.9.2.
  • Fixed documentation for the py2exe.freeze API.


  • Fixed an issue that prevented builds via the deprecated API.


  • Introduce the new py2exe.freeze API. Documentation can be found here.
  • Use of the py2exe command and of distutils is deprecated as per PEP 632. Both these interfaces will be removed in the next major release. See here for a migration guide.
  • Add two hooks to fix the bundling of winrt and passlib.


  • The log file for windows apps is now stored in %APPDATA% by default
  • ModuleFinder now raises an explicit error if a required module is in excludes
  • Restore hook functionality for pkg_resources
  • The Stderr.write method used for windows apps now returns the number of written bytes


  • Drop support for Python 3.6
  • Include package metadata in the bundle archive (to be used by e.g. importlib.metadata)
  • Fixed a bug that prevented to use the optimize option when six was in the bundle
  • Fixed a bug that ignored the optimize flag for some packages


  • Show again relative paths in Tracebacks that happen from the frozen application (#12 and #114)


  • New module finder mf310 written as a wrapper around CPython modulefinder.ModuleFinder
  • Add support for Python 3.10
  • New hook for scipy
  • zipextimporter can now be built as a standalone extension via its own setup script


  • ModuleFinder: add support for the pkg_resources.extern.VendorImporter loader
  • New hooks for pkg_resources and infi


  • zipextimporter supports external modules that use multi-phase initialization (PEP 489)
  • New hook for selenium
  • dllfinder provides a new method to add data files in the zip archive


  • New hook for pycryptodomex
  • ModuleFinder: respect excludes list in import_package
  • Updated hook for matplotlib >= 3.4.0


  • New hook for supporting matplotlib 3.2 and higher.
  • Fix for including implicit namespace packages as per PEP420.


  • Patch MyLoadLibrary to support ssl with bundle_files=0.


  • New module finder with support for implicit namespace packages (PEP 420).
  • DLLFinder automatically excludes VC++ redist and Windows CRT DLLs from bundles.
  • Several fixes for bundling software with bundle_files<=2 (only the standard library is supported, other dependencies may or may not work).
  • New hooks for pycryptodome and shapely.


  • Add support for Python 3.9.
  • Drop support for Python 3.5.
  • New hooks for urllib3 and pandas.

Version (from versions 0.9.x):

  • Introduce compatibility with Python 3.5, 3.6, 3.7, and 3.8.
  • Drop compatibility with Python 3.4 and earlier.
  • New or updated hooks for certifi, numpy, tkinter, socket, ssl, and six.
  • build_exe: the zipfile=None option has been removed.
  • runtime: the Python interpreter DLL is no longer altered before being inserted in the executable bundle.
  • Several bugfixes, better error messages.


pip install py2exe


Use the py2exe.freeze function as documented here.

Using a script or the builder

Using a script with py2exe is deprecated. Please adapt your scripts to use the new freeze API. This interface will be removed in the next major release.

The build_exe (or -m py2exe) CLI was removed in version

Known issues and notes

  • High-level methods or hooks to embed Qt plugins in the bundle (needed by PySide2/PyQt5) are missing.
  • (*) win32 wheels are provided without testing. Users are encouraged to use the win_amd64 wheels (see #157).


Further informations about the original development of py2exe and other usage guidelines can be found in the original README.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

py2exe- (154.6 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

py2exe- (146.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

py2exe- (154.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

py2exe- (146.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

py2exe- (154.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

py2exe- (146.3 kB view hashes)

Uploaded CPython 3.9 Windows x86

py2exe- (154.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

py2exe- (146.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page