Building Pygame2 using MinGW

Using MinGW on Win32 platforms is probably the most comfortable way to build and install Pygame2 on Windows, thanks to a handy script, that will do most of the work for you.

Note

At http://pygame.org/wiki/MingW you can find more information and details about the build and installation process.

Setting up MSYS and MinGW

First of all, you have to make sure, you have an up to date and working MinGW and MSYS installation running. If you have not, install both of them first. Visit http://mingw.org/ and follow their instructions to install and configure anything. The following setup has been tested to work well on several Win32 installations:

If anything went right, MSYS and MinGW should be set up correctly now. Now it’s time to get the dependencies.

Building the dependencies

Note

The following list of dependencies might not be the most actual one. Please check the README.txt file in the top source directory for the most actual dependency list!

Note

You can find a set of prebuilt dependencies at http://www3.telus.net/len_l/pygame/. Simply download the matching Win32 prebuilt package and unpack it within the source directory of pgreloaded (and rename it correctly).

Make sure, you have at least one of the following Python versions installed:

To build anything, you will have to download the following additional source packages:

And you will need the dependency packages for the packages above:

Once you downloaded all source packages, unpack them and put them all into a common directory, where the msys_build_deps.py script can find them. The script will search the directory where it resides, the parent directory of it and a directory named ‘deps’ for the unpacked sources.

Note

At this point, we strongly recommend a directory named ‘deps’ that is created under the Pygame2 source directory.

Once anything’s unpacked, move the Pygame2 source directory to your MSYS home directory (in a default installation this would be C:\msys\1.0\home\%USERNAME%). Start the Msys shell and change to the Pygame2 source directory:

cd pgreloaded

Now start the msys_build_deps.py script:

python msys_build_deps.py --all

This will start to build all necessary dependencies and takes some time to finish. Now is a good time to get yourself another cup of coffee and read the newspaper.

Building Pygame2

Now that all dependencies are built and installed, you can proceed to build and install Pygame2 itself. Simply type:

python setup.py build --compiler=mingw32 install

This will build and install Pygame2 in one step.

Table Of Contents

Previous topic

Building Pygame2 on Darwin

Next topic

Building Pygame2 using Microsoft Visual C++

This Page