py2exe problem

Hello,

I’ve been using matplotlib 0.87 and I upgraded to 0.91. I ran my setup script for py2exe which had been working flawlessly and now I get an error stating that the …/mpl-data/fonts is not a regular file or doesn’t exist. I checked the filename path and it does actually exist. I’m using the matplotlib function get_py2exe_datafiles() to get the matplotlib data files. how might I correct this issue (I pasted a small sample code below)? thanks.

Jeff

arguments for the setup() call

app = dict(
script = “App.py”,
other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog=“App”))],
icon_resources = [(1,‘Figures/my_icon.ico’)]
)

packages = [‘numpy’,
‘matplotlib’,
‘pytz’]

excludes = [

‘_gtkagg’,
‘_tkagg’,
‘tcl’,
‘Tkconstants’,
‘Tkinter’,
‘tcl’,
‘pywin.debugger’,
‘pywin.debugger.dbgcon’,
‘pywin.dialogs’,
‘bsddb’,
‘curses’,
‘email’,
‘distutil’,
‘logging’,
‘readline’,
‘setuptools’]

dll_excludes = [
‘libgdk_pixbuf-2.0-0.dll’,
‘libgobject-2.0-0.dll’,
‘libgdk-win32-2.0-0.dll’]

Options = {“py2exe”: {“skip_archive” : 1,
“packages” : packages,
“excludes” :
excludes,
“dll_excludes” : dll_excludes}}

MATPLOTLIB DATA

data_Files=[(".",
[“matplotlibrc”, “config.txt”, “user_agreement.rtf”, “main.css”]),
(“Figures”,glob.glob(“Figures\")),
(“Documents”,glob.glob("Documents\
”)),
(“images”,glob.glob(“images\*”)),
matplotlib.get_py2exe_datafiles()]

···

Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.

Hi Jeff,

Jeff Peery wrote:

Hello,
I've been using matplotlib 0.87 and I upgraded to 0.91. I ran my setup script for py2exe which had been working flawlessly and now I get an error stating that the .../mpl-data/fonts is not a regular file or doesn't exist. I checked the filename path and it does actually exist. I'm using the matplotlib function get_py2exe_datafiles() to get the matplotlib data files. how might I correct this issue (I pasted a small sample code below)? thanks.

The folder structure in matplotlib has changed.

Attached is a sample setup.py for the "embedding_in_wx.py" matplotlib
example which has a "hack" to deal with this. I haven't found a better
way to deal with this new folder structure, but for me this works.

Werner

setup.py (4.36 KB)

···

Jeff
# arguments for the setup() call
app = dict(
    script = "App.py",
    other_resources = [(RT_MANIFEST, 1, manifest_template % dict(prog="App"))],
    icon_resources = [(1,'Figures/my_icon.ico')]
)
packages = ['numpy',
    'matplotlib',
    'pytz']
excludes = [
    '_gtkagg',
    '_tkagg',
    'tcl',
    'Tkconstants',
    'Tkinter',
    'tcl',
    'pywin.debugger',
    'pywin.debugger.dbgcon',
    'pywin.dialogs',
    'bsddb',
    'curses',
    'email',
    'distutil',
    'logging',
    'readline',
    'setuptools']
dll_excludes = [
    'libgdk_pixbuf-2.0-0.dll',
    'libgobject-2.0-0.dll',
    'libgdk-win32-2.0-0.dll']

Options = {"py2exe": {"skip_archive" : 1,
            "packages" : packages,
            "excludes" : excludes,
            "dll_excludes" : dll_excludes}}
## MATPLOTLIB DATA
data_Files=[(".",
             ["matplotlibrc", "config.txt", "user_agreement.rtf", "main.css"]),
            ("Figures",glob.glob("Figures\\*")),
            ("Documents",glob.glob("Documents\\*")),
            ("images",glob.glob("images\\*")),
            matplotlib.get_py2exe_datafiles()]

------------------------------------------------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. <http://us.rd.yahoo.com/evt=51731/*http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ&gt;

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Dear Werner, I tested your script here here with python 2.5, matplotlib 0.91.1 and wxpython 2.8.7.1 using regular installation (not enthought).

If I replace :
from wx import *
by
import wx
(and make the necessary modification)

The program starts well!
(the button does not work but the problem is already present when running directly the python script)

embedding_in_wx.py (3.4 KB)