Python distutils

A guide to creating a simplistic .exe python package installer:

  1. Create a file in the directory above your package directory:
  2. Copy the following in
    from distutils.core import setup
    import setuptools
    import sys
        description='My Amazing Library',
        author='My Name',
        package_dir = {'':'.'},
  3. Open a command prompt in the directory containing the and execute
    python bdist_wininst
  4. Observe how the installer appears in the newly created dist directory.

Additional Notes

  • To specify that the installer is only for a specific Python install use the –target-version option with, eg:
    python bdist_wininst --target-version=2.5
  • Swap bdist_wininst to bdist_msi to create a Windows Installer for your python package.

Leave a Reply

Your email address will not be published. Required fields are marked *