Introduction
Changes required to matplotlib
I had to patch matplotlib's init.py file in the get_data_path() routine. Specifically, right before raising the error at the end, I added the following code
Special content for setup.py to use matplotlib
We also need to make sure we get the matplotlib subdirectory created in the distribution. This is where we'll include all of the stuff matplotlib includes in the pythonXX\share\matplotlib directory. This is also where the init file has been updated to look for this information.
1 # We need to import the glob module to search for all files.
2 import glob
3
4 # We need to exclude matplotlib backends not being used by this executable.
5 # You may find that you need different excludes to create a working executable with your chosen backend
6 opts = {
7 'py2exe': { 'excludes': ['_gtkagg', '_tkagg'],
8 'dll_excludes': ['libgdk-win32-2.0-0.dll',
9 'libgobject-2.0-0.dll']}
10
11 setup(
12 # Additional data files required by matplotlib. Note that the glob.glob routine doesn't seem to pick up the .matplotlib resource file