# PyPlot installation messed up

**URL:** <https://discourse.julialang.org/t/pyplot-installation-messed-up/59855>\
**Category:** New to Julia\
**Tags:** pluto\
**Created:** [April 23, 2021, 9:20am UTC](https://discourse.julialang.org/t/pyplot-installation-messed-up/59855 "2021-04-23T09:20:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pg261](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pg261/32/24270_2.png) [@pg261](https://discourse.julialang.org/u/pg261)\
**Post date:** [April 23, 2021, 9:20am UTC](https://discourse.julialang.org/t/pyplot-installation-messed-up/59855/1 "2021-04-23T09:20:12Z")

</div>

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 :

```julia
 MPLBACKEND=Agg julia

```

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

```julia
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

```julia
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

---

<div class="post-metadata">

**Author:** ![pg261](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pg261/32/24270_2.png) [@pg261](https://discourse.julialang.org/u/pg261)\
**Post date:** [April 23, 2021, 1:28pm UTC](https://discourse.julialang.org/t/pyplot-installation-messed-up/59855/2 "2021-04-23T13:28:13Z")

</div>

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:

```julia
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.
