Unable to use PyPlot either in Jupyter notebook or in terminal

I am on a Macbook pro with Big Sur, and I recently switched to Julia 1.6

When I tried to use the PyPlot package from a jupyter notebook, it keeps resetting the Julia kernel, and is unusable. Other Julia packages work fine in Jupyter.

When I try to use PyPlot in the terminal I get this error:

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

With an earlier version of Julia (1.5.3) and an older PyPlot, I was happily using them together.
What’s making things break so much in the recent version?

I checked that

@pyimport matplotlib

is the main culprit.

There are known issues with MKL and Pyplot, see here for some possible solutions

1 Like