unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* matplotlib broken
@ 2015-06-09 16:01 Federico Beffa
  2015-06-15 20:49 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Federico Beffa @ 2015-06-09 16:01 UTC (permalink / raw)
  To: Guix-devel

Hi,

today I've updated all packages in my profile and I find that
matplotlib doesn't work anymore.

Starting ipython3 and executing the following commands

%matplotlib
import numpy as np
import matplotlib.pyplot as plt
t = np.r_[0:5]
plt.plot(t, t)

now produces an empty, gray window, while with the previous profile it
was working fine. I'm not sure how old my previous profile is, but it
uses python3.3.

Just reporting the problem and, for the moment, sticking with the old one.

Regards,
Fede

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: matplotlib broken
  2015-06-09 16:01 matplotlib broken Federico Beffa
@ 2015-06-15 20:49 ` Ludovic Courtès
  2015-06-16  6:51   ` Federico Beffa
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2015-06-15 20:49 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> Starting ipython3 and executing the following commands
>
> %matplotlib
> import numpy as np
> import matplotlib.pyplot as plt
> t = np.r_[0:5]
> plt.plot(t, t)

I don’t know if I’m missing something, but when I type ‘matplotlib’ at
the prompt, I get:

--8<---------------cut here---------------start------------->8---
/gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py in <module>()
     19 except ValueError:
     20     raise ImportError(
---> 21         "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
     22         "to be installed.")
     23 

ImportError: Gtk3 backend requires the GObject introspection bindings for Gtk 3 to be installed.
--8<---------------cut here---------------end--------------->8---

This may well be related to <http://bugs.gnu.org/20765>: Because Guix
has incomplete dependency information, it might GC some of the things
that these eggs refer to, and so things may or may not work depending on
whether they have been GC’d.

WDYT?

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: matplotlib broken
  2015-06-15 20:49 ` Ludovic Courtès
@ 2015-06-16  6:51   ` Federico Beffa
  2015-06-16 11:50     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Federico Beffa @ 2015-06-16  6:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> I don’t know if I’m missing something, but when I type ‘matplotlib’ at
> the prompt, I get:
>
> /gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py in <module>()
>      19 except ValueError:
>      20     raise ImportError(
> ---> 21         "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
>      22         "to be installed.")
>      23
>
> ImportError: Gtk3 backend requires the GObject introspection bindings for Gtk 3 to be installed.
>
> This may well be related to <http://bugs.gnu.org/20765>: Because Guix
> has incomplete dependency information, it might GC some of the things
> that these eggs refer to, and so things may or may not work depending on
> whether they have been GC’d.

To solve this error I think you need to set
export GI_TYPELIB_PATH="$HOME/.guix-profile/lib/girepository-1.0"
We should probably add a search path specification for that.

For me it does display a window as expected, but it doesn't show the
curve (line in this case).

Thanks.
Fede

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: matplotlib broken
  2015-06-16  6:51   ` Federico Beffa
@ 2015-06-16 11:50     ` Ludovic Courtès
  2015-06-16 16:36       ` Federico Beffa
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2015-06-16 11:50 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> I don’t know if I’m missing something, but when I type ‘matplotlib’ at
>> the prompt, I get:
>>
>> /gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py in <module>()
>>      19 except ValueError:
>>      20     raise ImportError(
>> ---> 21         "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
>>      22         "to be installed.")
>>      23
>>
>> ImportError: Gtk3 backend requires the GObject introspection bindings for Gtk 3 to be installed.
>>
>> This may well be related to <http://bugs.gnu.org/20765>: Because Guix
>> has incomplete dependency information, it might GC some of the things
>> that these eggs refer to, and so things may or may not work depending on
>> whether they have been GC’d.
>
> To solve this error I think you need to set
> export GI_TYPELIB_PATH="$HOME/.guix-profile/lib/girepository-1.0"
> We should probably add a search path specification for that.

Oh right.  It’s actually in gobject-introspection, which makes sense but
is inconvenient in this case.  Not sure how to handle it.

> For me it does display a window as expected, but it doesn't show the
> curve (line in this case).

Indeed, in:

  guix environment --pure --ad-hoc gobject-introspection pango gtk+ python-ipython -E ipython

I get the behavior you describe, and the console shows alarming
warnings like:

  TypeError: Couldn't find foreign struct converter for 'cairo.Context'

which explains the blank page, I guess.  If Python’s FFI uses GIR files,
then that’s probably because it couldn’t find Cairo’s GIR files in
$GI_TYPELIB_PATH?

My 2¢,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: matplotlib broken
  2015-06-16 11:50     ` Ludovic Courtès
@ 2015-06-16 16:36       ` Federico Beffa
  0 siblings, 0 replies; 5+ messages in thread
From: Federico Beffa @ 2015-06-16 16:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Tue, Jun 16, 2015 at 1:50 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> I don’t know if I’m missing something, but when I type ‘matplotlib’ at
>>> the prompt, I get:
>>>
>>> /gnu/store/g4m8q73cq4lym3v1ag7pnk5zv49mdifs-python-matplotlib-1.4.2/lib/python3.4/site-packages/matplotlib-1.4.2-py3.4-linux-x86_64.egg/matplotlib/backends/backend_gtk3.py in <module>()
>>>      19 except ValueError:
>>>      20     raise ImportError(
>>> ---> 21         "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
>>>      22         "to be installed.")
>>>      23
>>>

I didn't get that error, so I deleted ~/.ipython and now I get it :-/

I guess one option would be to use another back-end.  One of the
supported back-ends is TkAgg which requires Tkinter which is a library
coming with python itself. However, to get the library we need to
compile python with Tk. We had a discussion about this a few month
back. I'm not sure if the work was not finished because people prefer
to have a smallish python, or because of technical difficulties.

Still another back-end is WXAgg, but currently we lack wxPython. If
the dependency tree is not too deep, this may be the easiest route to
a working (again) matplotlib.

Regards,
Fede

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-16 16:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 16:01 matplotlib broken Federico Beffa
2015-06-15 20:49 ` Ludovic Courtès
2015-06-16  6:51   ` Federico Beffa
2015-06-16 11:50     ` Ludovic Courtès
2015-06-16 16:36       ` Federico Beffa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).