Open rdeits opened 8 years ago
On Ubuntu, I think PyPlot defaults to the Gtk backend. However, by also loading the Julia Gtk
package, you are trying to process the Gtk event loop twice (once in the Julia Gtk package and once in Python), and it's not surprising that it fails.
One option would be to load PyPlot using a different, not-Gtk, backend. e.g. TkAgg. You can change the default backend in a variety of ways, e.g. in your .matplotlibrc
file , via the MPLBACKEND
environment variable, or by using PyCall; PyDict(matplotlib["rcParams"])["backend"] = "tkagg"
Ah, that makes sense, thanks!
I've actually tried loading PyPlot with different backends, but so far haven't been able to prevent the segfault. For example, I can do the following:
using PyCall
@pyimport matplotlib
PyDict(matplotlib.rcParams)["backend"] = "tkagg"
import PyPlot
import Gtk
PyPlot.figure()
and I still get the segfault. Substituting "qt"
for "tkagg"
also segfaults. Likewise, I tried following the instructions from the Readme to set the backend:
using PyCall
pygui(:qt)
import PyPlot
import Gtk
PyPlot.figure()
but that also segfaults with the same stack trace.
I'm having the same problem, did someone find a fix for this yet?
+1 here's the complete log on Travis
When running the following code, I get a segfault:
I'm on Ubuntu 14.04, with libgtk-3-dev (3.10.8-0ubuntu1.6) installed. I've reproduced the segfault with both the most recent tagged versions of Gtk.jl, PyCall.jl, and PyPlot.jl as well as the master branches of all of those packages.
The error message I get is:
I came across this segfault while trying to use https://github.com/timholy/ProfileView.jl (which indirectly imports Gtk.jl) on a module that also used PyPlot.
Has anyone encountered this before?