Problems with pylab and ipython on openSUSE – ImportError

These days I’m trying to use python+numpy+scipy to solve some academic problems, and when I tried to import pylab module I got those errors:

In [63]: import pylab
—————————————————————————
ImportError Traceback (most recent call last)
in ()
—-> 1 import pylab

/usr/lib64/python2.7/site-packages/pylab.py in ()
—-> 1 from matplotlib.pylab import *
2 import matplotlib.pylab
3 __doc__ = matplotlib.pylab.__doc__

/usr/lib64/python2.7/site-packages/matplotlib/pylab.py in ()
263 from numpy.linalg import *
264
–> 265 from matplotlib.pyplot import *
266
267 # provide the recommended module abbrevs in the pylab namespace

/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py in ()
95
96 from matplotlib.backends import pylab_setup
—> 97 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
98
99 @docstring.copy_dedent(Artist.findobj)

/usr/lib64/python2.7/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
23 backend_name = ‘matplotlib.backends.%s’%backend_name.lower()
24 backend_mod = __import__(backend_name,
—> 25 globals(),locals(),[backend_name])
26
27 # Things we pull in from all backends

ImportError: No module named backend_tkagg

After a few web search it was solved installing the package python-matplotlib-tk.

In openSUSE it means, as root:

zypper install python-matplotlib-tk

Reference: http://forums.opensuse.org/english/other-forums/development/programming-scripting/416182-python-matplolib.html

One thought on “Problems with pylab and ipython on openSUSE – ImportError

Leave a Reply