could not load matplotlib icon

I changed the code in cvs to

        import pygtk
        if not hasattr(sys, 'frozen'):
           pygtk.require('2.0')

  > I think that should fix it.

Perhaps it would be better to define a constant in
matplotlib.__init__.py, something like

matplotlib.PY2EXE = hasattr(sys, 'frozen')

because then the code which is conditional upon py2exe would be more
readable

        if not matplotlib.PY2EXE
           pygtk.require('2.0')

or something like that...

JDH

John Hunter wrote:

Perhaps it would be better to define a constant in
matplotlib.__init__.py, something like

matplotlib.PY2EXE = hasattr(sys, 'frozen')

because then the code which is conditional upon py2exe would be more
readable

        if not matplotlib.PY2EXE
           pygtk.require('2.0')

or something like that...

Except that Py2EXE is not the only method of "freezing" apps. In particular, you'd want this to work with OS-X's Py2App, and probably other methods of bundling apps.

you might want:

matplotlib.FROZEN = hasattr(sys, 'frozen')

and

if not matplotlib.FROZEN
    pygtk.require('2.0')

Then you could also accommodate other keywords that other bundling methods use.

BTW, is someone really successfully using PyGTK on Windows? Cool!

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Hi John,

I just installed 0.64 apparently successfully. However, none
of the examples run because POLAR cannot be imported.
I always get something like this:

[ads@...108... examples]$ python logo.py
Traceback (most recent call last):
  File "logo.py", line 3, in ?
    from matplotlib.matlab import *
  File "/usr/local/lib/python2.3/site-packages/matplotlib/matlab.py",
line 162,
in ?
    from axes import Axes, PolarAxes
  File "/usr/local/lib/python2.3/site-packages/matplotlib/axes.py", line
9, in ? from artist import Artist
  File "/usr/local/lib/python2.3/site-packages/matplotlib/artist.py",
line 4, in ?
    from transforms import identity_transform
  File
"/usr/local/lib/python2.3/site-packages/matplotlib/transforms.py", line
189, in ?
    from _transforms import IDENTITY, LOG10, POLAR, Func, FuncXY
ImportError: cannot import name POLAR

I'm on Redhat linux 9 and have installed every version
of matplotlib since 0.50.

What gives?

Thanks.

  -Al