Hello all,
I finally, after much pain and anguish, succeeded at compiling MPL with GTKAgg on windows and I thought people might be interested to know how I managed it. Of course, your mileage may vary…
- Install Python (I used the Python (x,y) distribution of 2.6: http://code.google.com/p/pythonxy/wiki/Downloads
- Install the GTK bits and pieces. For some reason using the newest ones causes some problems with paths. I can confirm that this set works on at least two computers:
Glade3.6.7withGTK+.exe (Install this to c:\GTK so that MPL build can find it without playing with paths)
pygtk-2.12.1-3.win32-py2.6.exe
pycairo-1.4.12-2.win32-py2.6.exe
pygobject-2.14.2-2.win32-py2.6.exe
- Install libpng and freetype using the installers (also includes the zlib dll). They will default to install to c:\Program Files\GnuWin32 . This is fine, but note the location.
- Either checkout the MPL source from subversion, or download a tarball and unpack it
- Download the win32_static files, and unpack them to the place where your MPL source is, you should then have a folder in the MPL source folder called win32_static
- Open the file setupext.py in the MPL source folder
- Edit line 51 (or so) to read:: ‘win32’ : [‘win32_static’,‘c:\Program Files\GnuWin32’]
- Install Visual Studio 2008 Express if you do not have a version of Visual Studio 2008 on your computer
- Open a console and type:: python setup.py build --compiler=msvc bdist_wininst
- Wait for it to finish, then:: python setup.py install to install MPL
- If everything worked right, you should be able to open a python shell and type
import matplotlib
matplotlib.use(‘GTKAgg’)
import pylab
pylab.plot(0,4,‘s’)
pylab.show()
- And you should see a GTK rendered plot window with a small square in the center hopefully
Improvements to this procedure would be greatly appreciated - but this finally seems to work…
Regards,
Ian
···
Ian Bell
Graduate Research Assistant
Herrick Labs
Purdue University
email: ibell@…901…
cell: (607)227-7626