I commented out the parts of my code that use matplotlib, and py2exe works fine. So the problem is with matplotlib, not wxPython. I'm still not sure what to do.
This is the setup.py file I'm using:
# setup.py
from distutils.core import setup
import py2exe
from distutils.filelist import findall
import os
import matplotlib
matplotlibdatadir = matplotlib.get_data_path()
matplotlibdata = findall(matplotlibdatadir)
matplotlibdata_files = []
for f in matplotlibdata:
dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:])
matplotlibdata_files.append((os.path.split(dirname)[0], [f]))
setup(
windows=["dataview_gui.py"],
options={
'py2exe': {
'packages' : ['matplotlib'],
'dll_excludes': ['wxmsw26uh_vc.dll'],
},
},
data_files=matplotlibdata_files
)