pygtk

Michael Droettboom wrote:

What does

python -c "import gtk"

say?

python2.6 -c "import gtk"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py",
line 48, in <module>
    from gtk import _gtk
  File "/usr/lib64/python2.6/site-packages/cairo/__init__.py", line 1,
in <module>
    from _cairo import *
ImportError: /usr/lib64/python2.6/site-packages/cairo/_cairo.so:
undefined symbol: cairo_ps_surface_set_eps

···

Mike

David Trethewey wrote:

Although I have python-gtk installed I still get this error message when
importing pylab. I'm not sure why. Can anyone enlighten me?

from pylab import *
        

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pylab.py", line
253, in <module>
    from matplotlib.pyplot import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line
75, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
    globals(),locals(),[backend_name])
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py",

line 10, in <module>
    from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
FigureCanvasGTK,\
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py",
line 11, in <module>
    raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.

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

This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  

I haven't seen this before, but it definitely looks like an installation problem with pygtk and/or pycairo, since it fails without matplotlib even entering into it. In particular, it looks like a possible mismatch between the versions of pycairo and cairo. Is everything installed from your distro's packages, or did you build this yourself?

Until "import gtk" works, there's little matplotlib can do, unfortunately. You may want to head over to the pygtk list for help if you're still stuck.

Mike

David Trethewey wrote:

···

Michael Droettboom wrote:
  

What does

python -c "import gtk"

say?
    

python2.6 -c "import gtk"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py",
line 48, in <module>
    from gtk import _gtk
  File "/usr/lib64/python2.6/site-packages/cairo/__init__.py", line 1,
in <module>
    from _cairo import *
ImportError: /usr/lib64/python2.6/site-packages/cairo/_cairo.so:
undefined symbol: cairo_ps_surface_set_eps

Mike

David Trethewey wrote:
    

Although I have python-gtk installed I still get this error message when
importing pylab. I'm not sure why. Can anyone enlighten me?

from pylab import *
        

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pylab.py", line
253, in <module>
    from matplotlib.pyplot import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line
75, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
    globals(),locals(),[backend_name])
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py",

line 10, in <module>
    from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
FigureCanvasGTK,\
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py",
line 11, in <module>
    raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.

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

This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Or simply set your backend to tkagg

  http://matplotlib.sourceforge.net/users/customizing.html
  http://matplotlib.sourceforge.net/faq/installing_faq.html#id1

JDH

···

On Wed, Jan 21, 2009 at 11:56 AM, Michael Droettboom <mdroe@...86...> wrote:

I haven't seen this before, but it definitely looks like an installation
problem with pygtk and/or pycairo, since it fails without matplotlib
even entering into it. In particular, it looks like a possible mismatch
between the versions of pycairo and cairo. Is everything installed from
your distro's packages, or did you build this yourself?

Until "import gtk" works, there's little matplotlib can do,
unfortunately. You may want to head over to the pygtk list for help if
you're still stuck.

I have switched between python2.5 and 2.6, so maybe I've messed up the
installation somehow, and it's not looking for things in the right
directories.

I fiddled around with the versions of cairo and pycairo, and got them to
match but still got errors:

import gtk

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py",
line 48, in <module>
    from gtk import _gtk
ImportError: /usr/lib64/libcairo.so.2: undefined symbol:
pixman_region32_rectangles

Also using tk doesn't work either:

import pylab

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pylab.py", line
253, in <module>
    from matplotlib.pyplot import *
  File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line
75, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
    globals(),locals(),[backend_name])
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_tkagg.py",
line 8, in <module>
    import tkagg # Paint image to Tk photo blitter extension
  File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/tkagg.py", line
1, in <module>
    import _tkagg
ImportError: No module named _tkagg

John Hunter wrote:

···

On Wed, Jan 21, 2009 at 11:56 AM, Michael Droettboom <mdroe@...86...> wrote:

I haven't seen this before, but it definitely looks like an installation
problem with pygtk and/or pycairo, since it fails without matplotlib
even entering into it. In particular, it looks like a possible mismatch
between the versions of pycairo and cairo. Is everything installed from
your distro's packages, or did you build this yourself?

Until "import gtk" works, there's little matplotlib can do,
unfortunately. You may want to head over to the pygtk list for help if
you're still stuck.

Or simply set your backend to tkagg

  http://matplotlib.sourceforge.net/users/customizing.html
  http://matplotlib.sourceforge.net/faq/installing_faq.html#id1

JDH

Got it working using tkAgg by recompiling matplotlib from source.

David

···

On Jan 21 2009, David Trethewey wrote:

I have switched between python2.5 and 2.6, so maybe I've messed up the
installation somehow, and it's not looking for things in the right
directories.

I fiddled around with the versions of cairo and pycairo, and got them to
match but still got errors:

import gtk

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py",
line 48, in <module>
   from gtk import _gtk
ImportError: /usr/lib64/libcairo.so.2: undefined symbol:
pixman_region32_rectangles

Also using tk doesn't work either:

import pylab

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.6/site-packages/pylab.py", line 1, in <module>
   from matplotlib.pylab import *
File "/usr/lib64/python2.6/site-packages/matplotlib/pylab.py", line
253, in <module>
   from matplotlib.pyplot import *
File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line
75, in <module>
   new_figure_manager, draw_if_interactive, show = pylab_setup()
File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
   globals(),locals(),[backend_name])
File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_tkagg.py",
line 8, in <module>
   import tkagg # Paint image to Tk photo blitter extension
File
"/usr/lib64/python2.6/site-packages/matplotlib/backends/tkagg.py", line
1, in <module>
   import _tkagg
ImportError: No module named _tkagg

John Hunter wrote:

On Wed, Jan 21, 2009 at 11:56 AM, Michael Droettboom <mdroe@...86...> >> wrote:

I haven't seen this before, but it definitely looks like an installation
problem with pygtk and/or pycairo, since it fails without matplotlib
even entering into it. In particular, it looks like a possible mismatch
between the versions of pycairo and cairo. Is everything installed from
your distro's packages, or did you build this yourself?

Until "import gtk" works, there's little matplotlib can do,
unfortunately. You may want to head over to the pygtk list for help if
you're still stuck.

Or simply set your backend to tkagg

  http://matplotlib.sourceforge.net/users/customizing.html
  http://matplotlib.sourceforge.net/faq/installing_faq.html#id1

JDH

------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net matplotlib-users List Signup and Options