Pygame Package Builder

Current Version: 0.4 BETA


November 2, 2009 – Fixed a bug which could halt assembling the executable if running with Unicode version of wxPython.

September 1, 2009 – Fixed a few problems not recognizing win32com and pythoncom not being installed.  Also fixed a fatal build error when using a Python version other than 2.5.   It should now work with any version of Python.


A complete build environment for pygame-based Python projects.

Pygame Package Builder’s aim is to be a complete build automation environment for pygame-based projects. The system can be used from 2 programs: the GUI (built using wxPython) to create automation project files, and the command-line utility which can use the same project files. Both can perform builds.

The principal purpose of PPB is to take a lot of the guesswork out of writing custom build scripts for pygame projects and gives the optimal output.


This beta release requires a minimum of the following:

  • Python 2.5.1 or greater
  • Distutils
  • Py2exe 0.6.6 or greater (optional but recommended)
  • wxPython 2.8.0 or greater
  • psyco (optional but recommended)
  • win32com and pythoncom for Windows (optional but recommended)


To start up the GUI for PPB, go to your shell/command line at the installation folder and type:

python -OO

Windows Users: In the Options dialog (Tools->Options…) on the Help tab, there is a button which will create a shortcut on your desktop to launch PPB.


PPB Interface 01

PPB Interface 02

PPB Interface 03

PPB Interface 04


Download the source here to get started: Pygame Package Builder 0.4 Beta Source Code


Constructive feedback, bugs, or suggestions on PPB are welcome. Since it is a moderately complex application, I will try my best to make sure that everything works.

For now, leave feedback below.  That way I can keep track of who, and when. If I get a lot of feedback or others that want to join in helping make PPB better, I will move PPB off here to Sourceforge or Freshmeat.


Obviously not everything could be completed, although I did try hard to make sure everything in this release got in there. Most of the features and code that are needed deal with cross-platform capabilities.

TODO LIST (in no particular order):

  1. Formalize and add support for OS X and py2app as a target for builds. This would then allow you to build your projects on one platform for both Mac and Windows simultaneously. Since I do not own a Mac, this might be problematic for me.
  2. Make a binary-only release of PPB. This is low priority at the moment since PPB is a developer’s tool and not an end-user application.
  3. More complete help files/multiple help file output sources for different platforms.

16 thoughts on “Pygame Package Builder

  1. This seems like it would be an incredibly valuable tool, but I have trouble getting it to work. When I tried to build my project, I ended up getting an error at this point:

    *** Finding Required DLLs ***
    *** Fatal Build Error ***
    ImportError(‘Module use of python25.dll conflicts with this version of Python.’,)

    I’m a Windows XP user with Python 2.6 (and the corresponding versions of pygame, py2exe, and wxPython) so I was wondering where that particular file is from. Searching my system did turn up two instances of “python25.dll”, but they’re in directories outside of my Python installation (such as for Maya). I don’t know if the error is due to PPB trying to access those outside files, but if it is, how do I tell it where my Python installation is? Since an installation path wasn’t specified, I currently have a subdirectory in my Python26 folder called “pygame_builder” with the contents of the ZIP file.

    Also, instead of using the command line instructions, I simply double-click on the file to open it. Finally, when I try to follow the “Windows user” tip inside of PPB and click Options, my DOS prompt window spews out text ending in “NameError: global name ‘shell’ is not defined”.

    Be advised that I’ve only been using Python for about four months at the most, and that most of my work has been inside of Eclipse, so I have very little experience with either IDLE or the command line.

    1. I think the first problem seems to be related to some code on the packaging system. That can be fixed to be more version-neutral.

      The shell error might be goof on my part in trying to access a variable that isn’t there. Fixable as well.

      Thank you for bringing this to my attention. I’ll get on it ASAP.

  2. Hi there! I was trying out this program and ran into an error, the details of which I won’t describe here unless needed.

    It seems like the root cause of it is that it’s looking to read configuration info from a file called ‘pyg.conf’. Is this correct? If so, this file should be included with future distributions of the program.

  3. Excuse the ignorance but is pyg2ex something different than py2exe?
    pygame_builder @ Line 29 appends this and I haven’t
    heard of this before and it’s not in the included source code.

    1. @John: No ignorance there. Originally I had forked py2exe into pyg2exe (short for Pygame 2 Exe), but now that is no longer needed. Good eye there, I’ve replaced that line with the correct one.

  4. Great work, this seems like exactly the thing i need.

    However i get this error i can’t figure out.
    It does its job for a while, until i get this:

    setting sys.winver for ‘distpython26.dll’ to ”
    *** Fatal Build Error ***
    TypeError(‘decoding Unicode is not supported’,)

    Build failed. Cleaning up…

    I’ve tried disabling “ASCII encoding only”, and as far as i know there’s no Unicode anywhere in my game.

    Any tips would be greatly appreciated.

  5. Has anyone else noticed that you cannot build a project more than once without restarting the program? And it also seems to work, even though I always get a
    “*** Fatal Build Error ***
    IOError(2, ‘No such file or directory’)

    Build failed. Cleaning up…”
    Error. Any suggestions?

    1. That appears to be a limitation of py2exe, which wasn’t designed to be called more than once inside of a script. I thought I had put a notice at the bottom of the build log that said something to that effect.

      If you want a more automated alternative, check out, which takes a project file as an argument and runs the build process.

  6. Hello, im having trouble making my pygame to exe, what happen in that when i run my .exe file, a error message pops up, ssaying, c++ visual runtime error, im new to pygame, and i would realy apreciate help
    my program consists in several clases, and a data folder with images,
    here is my email: if anyone wants to help me
    thanks alot

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.