PY2EXE with Matplotlib and wxPython compiles but won't run???

Werner F. Bruhin <werner.bruhin@...83...> writes:

  I'm trying to build an executable using
PY2EXE; running Python 2.5.2 and wxPython 2.8.10.1 and MatplotLib 0.99.0
  I tried using the setup.py from the
PY2EXE.org Matplotlib page and although everything compiles correctly
and generates an executable.
  When I launch the executable I get the
following error:
  ================================================
  "The application requires a version of
wxPython greater than or equal to 2.8, but a matching version was not
found."
  You currently have these version(s)
installed.
  
  ================================================
  
  I can compile an executable with PY2EXE and
wxPython that works fine, but apparantly somethins in the setup for
matplotlib is causing a problem.
  
  Has anyone else seen this problem or know of
a solution?

You need to patch matplotlib (backend_wx.py), see the bottom of this
page:MatPlotLib - py2exe.org
Werner

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

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...83...
matplotlib-users List Signup and Options

Thanks for the reply Werner,
I decided to try and construct the executable from the site using the
"embedding_in_wx2.py" example. Again making sure the patch was in place on the
backend_wx.py I again ran the python setup.py py2exe and everything compiled.
Now when I run the exe it generate the following log file errors:
Traceback (most recent call last):
  File "embedding_in_wx2.py", line 21, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\backends\backend_wxagg.pyo", line 20, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\figure.pyo", line 19, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\axes.pyo", line 14, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\collections.pyo", line 21, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\backend_bases.pyo", line 32, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\widgets.pyo", line 12, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "matplotlib\mlab.pyo", line 376, in <module>
TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'

···

On 19/05/2010 19:55, David Grudoski wrote:

This is due to using "optimize 1 or 2" in py2exe, the work around is to fix four lines in mpl.mlab.py as shown on the wiki page mentioned in the last thread.

Werner

···

On 19/05/2010 20:45, David wrote:

Werner F. Bruhin<werner.bruhin@...83...> writes:

On 19/05/2010 19:55, David Grudoski wrote:

   I'm trying to build an executable using
PY2EXE; running Python 2.5.2 and wxPython 2.8.10.1 and MatplotLib 0.99.0
   I tried using the setup.py from the
PY2EXE.org Matplotlib page and although everything compiles correctly
and generates an executable.
   When I launch the executable I get the
following error:
   ================================================
   "The application requires a version of
wxPython greater than or equal to 2.8, but a matching version was not
found."
   You currently have these version(s)
installed.

   ================================================

   I can compile an executable with PY2EXE and
wxPython that works fine, but apparantly somethins in the setup for
matplotlib is causing a problem.

   Has anyone else seen this problem or know of
a solution?

You need to patch matplotlib (backend_wx.py), see the bottom of this
page:MatPlotLib - py2exe.org
Werner

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

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...83...
matplotlib-users List Signup and Options

Thanks for the reply Werner,
I decided to try and construct the executable from the site using the
"embedding_in_wx2.py" example. Again making sure the patch was in place on the
backend_wx.py I again ran the python setup.py py2exe and everything compiled.
Now when I run the exe it generate the following log file errors:
Traceback (most recent call last):
   File "embedding_in_wx2.py", line 21, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\backends\backend_wxagg.pyo", line 20, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\figure.pyo", line 19, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\axes.pyo", line 14, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\collections.pyo", line 21, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\backend_bases.pyo", line 32, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\widgets.pyo", line 12, in<module>
   File "zipextimporter.pyo", line 82, in load_module
   File "matplotlib\mlab.pyo", line 376, in<module>
TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'