New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTK backends #5793
Comments
attn @fariza Getting that table updated in the next day or two would be great. |
For Gtk2, since this FAQ was written, pycairo became an indirect dependency of pygtk. So any installation of pygtk should include cairo anyway, but we can be more specific here it we want. In the case of Gtk3, matplotlib has to use cairo directly to copy the Agg buffer to the screen (since Gtk3 removes the old-fashioned Gtk rendering entirely in favor of Cairo). Unfortunately I can't reproduce the bugs you describe. Did you install everything through the same package manager? One problem with cairocffi (and any ctypes/cffi wrapper) is that if the versions of gobject/gtk/cairocffi don't match (and by "match" I don't mean the same number, I mean "designed to work together"), then things will "sort of" work like this but not quite. The short answer is usually to just install everything from the same place (i.e. Linux package manager) and hope that the packagers have got everything right. In the case of your bugs, you may want to confirm whether it's a matplotlib problem by trying to run any of the cairocffi examples. I think updating the table as you suggest is exactly right. |
Humpf. I can't reproduce it anymore either, I'm a bit confused. GTK3Agg: Agg rendering to a GTK 3.x canvas (requires PyGObject and cairocffi | cairocffi or pycairo) Anyways, even just adding that PyGTK is Python2 only would save time for testers like myself who have no clue about GTK and wasted 30min figuring out whether or not I should try testing unicode support with PyGTK on Python3 :-) |
Did you build py3cairo from the master branch? With the latest official release of py3cairo (which is from 2011) it doesn't work for me. I get a Looking at the git repository this might have been added at some point in 2012 but there has been no release of py3cairo since 2011 |
Yeah -- Python3/Gtk3 requires cairocffi, not py3cairo (which should be clarified by the proposed doc changes above). py3cairo has had implementing create_for_data on their TODO list for ages -- I even submitted a patch myself -- but it seems py3cairo is just dead at this point in favor of cairocffi. |
@mdboom It's actually looks like they have implemented it. There are a few (<20) commits in their git repository after the 2011 release and one of them claims to implement it but that is not in a release yet |
Yup, I built pycairo from master. |
Ah -- well that explains why it works for @anntzer. I think it's still reasonable to keep our warning, since for most users what matters is the released version of py3cairo. |
Closed by #5818 |
I'm going to allow myself reopening this issue, as I can again reproduce it python 3.6.1 python-gobject 3.24.1 python-cairocffi 0.8.0-2 all from Arch Linux repos; matplotlib 2.0.2 or master. Trying the gtk3agg backend, I now get the error
with no traceback, and a blank window. Interestingly, this 1. does not happen with Py2 (likewise Arch repos), 2. nor on another machine... |
And the issue is gone again... |
And again, same as described by @anntzer (TypeError, no traceback, blank window) Would appreciate ideas how to debug or query my system for info relevant for tracking this... |
Currently, the FAQ lists the following possibilities for GTK-based interactive backends:
GTKAgg: Agg rendering to a GTK 2.x canvas (requires PyGTK)
GTK3Agg: Agg rendering to a GTK 3.x canvas (requires PyGObject)
GTK: GDK rendering to a GTK 2.x canvas (not recommended) (requires PyGTK)
GTKCairo: Cairo rendering to a GTK 2.x canvas (requires PyGTK and pycairo)
GTK3Cairo: Cairo rendering to a GTK 3.x canvas (requires PyGObject and pycairo)
In fact, it seems that cairocffi or pycairo is always needed (
backend_gtk3agg.py
line 12:from .backend_cairo import ...
). But with cairocffi 0.7.2, I getand the same error without the chained traceback on Python2 (and no plot on the figure).
On the other hand, pycairo 1.10.1 seems to work fine on the same basic example, even though somewhat ironically, on Python3 it prints out the warning
Also, for Python2,
pycairo
seems to be a hard dependency ofpygtk
.Unless there are plans to change/fix the issues, I would suggest to update the list of GTK-based backends to
GTK: GDK rendering to a GTK 2.x canvas (not recommended) (requires PyGTK; Python2 only)
GTKAgg: Agg rendering to a GTK 2.x canvas (requires PyGTK; Python2 only)
GTKCairo: Cairo rendering to a GTK 2.x canvas (requires PyGTK; Python2 only)
GTK3Agg: Agg rendering to a GTK 3.x canvas (requires PyGObject and cairocffi)
GTK3Cairo: Cairo rendering to a GTK 3.x canvas (requires PyGObject and cairocffi)
(I don't actually use gtk myself :-), I just want to see what combos I need to test for whether the status bar text supports unicode...)
The text was updated successfully, but these errors were encountered: