PyPlot installation messed up

Hello,

I have tried to use PyPlot, and now i think i’ve messed things up.

Initially, the installation went fine, and it was possible to import the module. I tried to plot something (my ultimate goal is to plot a matrix in julia, it seems modest enough…) within a Pluto notebook (did not even try the REPL), but it didn’t work. Instead of an image i just got a message “plotting object” or something.

So I foolishly googled around and ended up running julia like this :

 MPLBACKEND=Agg julia

This made things much worse! Now whenever I try to import PyPlot, Julia crashes entirely with:

INTEL MKL ERROR: dlopen(/Users/guillot/.julia/conda/3/lib/libmkl_intel_thread.1.dylib, 9): Library not loaded: @rpath/libiomp5.dylib
  Referenced from: /Users/guillot/.julia/conda/3/lib/libmkl_intel_thread.1.dylib
  Reason: image not found.
Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.1.dylib.

More googling has led me to run julia with

LD_LIBRARY_PATH=$HOME/.julia/conda/3/lib julia

Now this sort-of works: I can import PyPlot, and within the REPL I can plot things. But I need to do this every time I run Julia – this was not needed originally! Incidentally, with Pluto I’m still unable to plot anything.

I’m so confused with the fact that the MPLBACKEND thing seems to have permanent effects, while the LD_LIBRARY_PATH one needs to be done every time.

Also, if I try to import PyPlot from IJulia, the notebook just seems to loop forever (doesn’t exactly crash, though). This is with or without the LD_LIBRARY_PATH thing.

(1) Can someone tell me what to do to be able to run julia normally (that is, typing just julia) and at least be able to import PyPlot at the REPL ? I have tried to update PyPlot, to no avail.

(2) Can i un-install PyPlot, at least? (I hate the idea of having a module installed that would crash everything if loaded…)

(3) As a bonus, if anybody knows a way to plot a matrix within Pluto, similar to PyPlot.matshow… then I’m interested…

thanks!
Pierre

Partially answering my own question: I have removed PyPlot (remove PyPlot in Pkg mode), and in order to draw a matrix with Plots.jl one can do:

A= rand(10,10) # the matrix to plot
Plots.heatmap(A, color=Plots.cgrad([:black, :red, :yellow, :white]))

(Short version: what I was expecting to be called matrix_plot or something is really called heatmap. I wish I had found such a concise example two hours ago…)

I’m not sure which backend is used, then. And I still don’t know what I did wrong above.