Plots PyPlot backend issue


Using the pyplot backend triggered segmentation fault in the REPL. After uninstalling everything related to Plots and PyPlot, trying fresh environments, I reluctantly reinstalled ALL my julia setup from scratch.

Now, in an empty environment, I install ONLY Plots and PyPlot and execute the following simple test:

using Plots

x = collect(0.0:0.1:10)
graphe = plot(sin.(x))

I may display the graph by issuing “graphe” in the REPL. Then, curiously, the window displaying the graph has the iconic menu of PyPlot in the lower border while previously, it was in the upper border of the window.

The worst part is that if I close the window and reissue “graphe” in the REPL, I no longer get the graph but as error, here are the first few lines of the (rather long) message, then the stacktrace follows:

julia> graphe
Error showing value of type Plots.Plot{Plots.PyPlotBackend}:
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/dussault/.julia/packages/PyCall/L0fLP/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class ‘_tkinter.TclError’>
TclError(‘invalid command name “.!navigationtoolbar2tk.!button2”’)
File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/”, line 2784, in clear
File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/”, line 2766, in clf
File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/”, line 3302, in update
File “/home/testjulia/.julia/conda/3/lib/python3.9/site-packages/matplotlib/backends/”, line 721, in set_history_buttons
self._buttons[‘Back’][‘state’] = state_map[can_back]
File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/”, line 1657, in setitem
self.configure({key: value})
File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/”, line 1646, in configure
return self._configure(‘configure’, cnf, kw)
File “/home/testjulia/.julia/conda/3/lib/python3.9/tkinter/”, line 1636, in _configure, cmd)) + self._options(cnf))

A week ago, I had no such issues but suddenly, an unexplained contamination led to the segmentation fault issue and my new fresh installation still has those strange behaviors.

Any suggestion will be much appreciated! In particular, I would appreciate comments from users that experienced such contaminations yielding systematically segmentation faults.

I use Ubuntu 20.04LTS and Julia Version 1.7.1 (2021-12-22)