PyPlot error and it crashes the REPL

The problem is identified. It is a matter of backend invoked on macOS.
The following “workaround” works (see https://github.com/JuliaPy/PyPlot.jl/issues/433):
In the REPL, type ‘using PyPlot’. If the command PyPlot.backend reports tkagg
then the setting is pointing to tk, a backend broken on macOS(?).

  1. add IJulia
  2. and the configuration of the backend in use is updated to qt5;
    the command PyPlot.backend returns qt5agg

It fixes the issues, PyPlot is back!