You are not logged in.

#1 2014-01-09 17:48:42

timtro
Member
Registered: 2013-12-13
Posts: 5

[UNSOLVED] Pylab requires pygtk, but already installed

Hi there,

I've installed ipython, numpy, scipy, matplotlib, python-pyzmq, python-jinja, python-tornado and pygtk out of the repos.

In python interactive (or upon starting ipython --pylab), I get the error

Python 3.3.3 (default, Nov 26 2013, 13:33:18) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab as pl
Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_gtk.py", line 12, in <module>
    import gobject
ImportError: No module named 'gobject'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.3/site-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/lib/python3.3/site-packages/matplotlib/pylab.py", line 269, in <module>
    from matplotlib.pyplot import *
  File "/usr/lib/python3.3/site-packages/matplotlib/pyplot.py", line 98, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/__init__.py", line 28, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in <module>
    from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_gtk.py", line 16, in <module>
    raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.

But pygtk is installed!

I've Goggled, and only found a year old problem that was supposedly fixed. Does anyone have any suggestions?


EDIT: change 'closed' to 'solved' in the subject ~fukawi2
EDIT: changed 'solved' to 'unsolved', for accuracy.

Last edited by timtro (2014-04-16 23:59:29)

Offline

#2 2014-01-09 17:52:56

timtro
Member
Registered: 2013-12-13
Posts: 5

Re: [UNSOLVED] Pylab requires pygtk, but already installed

Thought I had it solved, but then I tried

ipython --matplotlib Gtk

and I get the same error.

I can import pygtk.

Looking at /usr/lib/python3.3/site-packages/matplotlib/backends/backend_gtk.py it's throwing here:

try:
    import gobject
    import gtk; gdk = gtk.gdk
    import pango
except ImportError:
    raise ImportError("Gtk* backend requires pygtk to be installed.")

So, it's trying to import gtk. Is this some sort of version problem?

Last edited by timtro (2014-01-10 20:14:22)

Offline

#3 2014-01-09 18:35:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [UNSOLVED] Pylab requires pygtk, but already installed

Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

#4 2014-01-09 21:40:33

timtro
Member
Registered: 2013-12-13
Posts: 5

Re: [UNSOLVED] Pylab requires pygtk, but already installed

karol wrote:

Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

It's not so solved as I thought. I will though.

Offline

#5 2014-01-09 23:28:39

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [UNSOLVED] Pylab requires pygtk, but already installed

It seems to be an upstream error. The Python3 port of Matplotlib is still in a transitional state afaict.

Incidentally, please place your code

inside code tags

to increase the legibility of your posts.


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#6 2014-01-10 20:15:33

timtro
Member
Registered: 2013-12-13
Posts: 5

Re: [UNSOLVED] Pylab requires pygtk, but already installed

Xyne wrote:

It seems to be an upstream error. The Python3 port of Matplotlib is still in a transitional state afaict.

Incidentally, please place your code

inside code tags

to increase the legibility of your posts.

Done. Thanks.

Offline

#7 2014-01-10 20:18:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [UNSOLVED] Pylab requires pygtk, but already installed

Don't use '[closed]', but e.g. [solved]. 'closed' means a moderator closed the thread and you can't post here anymore.

Offline

#8 2014-04-17 01:37:00

Liquen
Member
Registered: 2009-01-04
Posts: 40

Re: [UNSOLVED] Pylab requires pygtk, but already installed

For anyone still having this problem, the line

backend      : Qt4Agg

in ~/.config/matplotlib/matplotlibrc seems to solve the problem.

Offline

Board footer

Powered by FluxBB