There seems to be a compatibility issue with Numpy V1.1 and Py2Exe V0.6.8 which I have installed on XP along with Python V2.5.2 and SciPy V0.6.0.

The compilation proceeds without incident apart from the usual list of missing modules but when the executable is run, the following error arises:

Traceback (most recent call last):
  File "Magnetic_Data_Processor.py", line 4, in <module>
    import matplotlib
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\__init__.pyo", line 128, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\rcsetup.pyo", line 18, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\colors.pyo", line 37, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "numpy\__init__.pyo", line 93, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "numpy\add_newdocs.pyo", line 9, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "numpy\lib\__init__.pyo", line 19, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "numpy\lib\financial.pyo", line 78, in <module>
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

I've tried removing the import of the finacial module by editing the lib.__init__ as I don't use the financial module anyway but then it just proceeds past this to a similar problem with the ma.core module:

  File "numpy\ma\core.pyo", line 3273, in <module>
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

I need this ma.core so I'm a bit stuck.

Any help would be very much appreciated. I've tried a number of approaches and I'm struggling a little. Oh, also python is installed to C:\Python25

Thanks,
James


Setup.py:


from distutils.core import setup
import py2exe
import shutil
import sys, os
import matplotlib

sys.argv += ['py2exe', '-b1', '-d./']
includes = ["matplotlib.numerix.random_
array","numpy.core._internal"]
excludes = [
    '_gtkagg',
    '_tkagg',
    'tcl',
    'Tkconstants',
    'pywin.debugger',
    'pywin.debugger.dbgcon',
    'pywin.dialogs',
    'bsddb',
    'curses',
    'email',
    'logging',
    'readline',
    'setuptools',
]
dll_excludes  = ['libgdk-win32-2.0-0.dll','libgobject-2.0-0.dll',"libgdk_pixbuf-2.0-0.dll"]
packages = ['numpy','scipy','matplotlib','pytz']

setup(
    # Alternative is console
    windows=["Magnetic_Data_Processor.py"],
    zipfile=None,
    options = {"py2exe": {"compressed": 1,
                          "optimize": 2,
                          "ascii": 1,
                          "bundle_files": 1,
                          "packages": packages,
                          "includes": includes,
                          "excludes": excludes,
                          "dll_excludes": dll_excludes}},
    data_files = matplotlib.get_py2exe_datafiles()
    )
   
shutil.rmtree('build')
os.remove('w9xpopen.exe')