Something seems to have gone wrong with my conda/julia setup. The following commands:
using Plots
pyplot()
now generate the error:
InitError: PyError (PyImport_ImportModule
The Python package matplotlib.pyplot could not be imported by pyimport. Usually this means
that you did not install matplotlib.pyplot in the Python version being used by PyCall.
PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the matplotlib.pyplot module, you can
use `pyimport_conda("matplotlib.pyplot", PKG)`, where PKG is the Anaconda
package the contains the module matplotlib.pyplot, or alternatively you can use the
Conda package directly (via `using Conda` followed by `Conda.add` etcetera).
Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.
) <class 'ImportError'>
ImportError('dlopen(/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/_png.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libpng16.16.dylib\n Referenced from: /Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/_png.cpython-37m-darwin.so\n Reason: Incompatible library version: _png.cpython-37m-darwin.so requires version 51.0.0 or later, but libpng16.16.37.0.dylib provides version 16.0.0')
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 31, in <module>
import matplotlib.colorbar
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
import matplotlib.contour as contour
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/contour.py", line 21, in <module>
import matplotlib.text as text
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/text.py", line 22, in <module>
from .textpath import TextPath # Unused, but imported by others.
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/textpath.py", line 20, in <module>
from matplotlib.mathtext import MathTextParser
File "/Users/gideonsimpson/.julia/conda/3/lib/python3.7/site-packages/matplotlib/mathtext.py", line 38, in <module>
from matplotlib import _png, colors as mcolors, get_data_path, rcParams
during initialization of module PyPlot
Stacktrace:
[1] pyimport(name::String)
@ PyCall ~/.julia/packages/PyCall/BD546/src/PyCall.jl:550
[2] __init__()
@ PyPlot ~/.julia/packages/PyPlot/XHEG0/src/init.jl:195
[3] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:674
[4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:760
[5] _require(pkg::Base.PkgId)
@ Base ./loading.jl:998
[6] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:914
[7] require(into::Module, mod::Symbol)
@ Base ./loading.jl:901
[8] top-level scope
@ ~/.julia/packages/Plots/SVksJ/src/backends.jl:505
[9] eval
@ ./boot.jl:360 [inlined]
[10] _initialize_backend(#unused#::Plots.PyPlotBackend)
@ Plots ~/.julia/packages/Plots/SVksJ/src/backends.jl:504
[11] backend
@ ~/.julia/packages/Plots/SVksJ/src/backends.jl:174 [inlined]
[12] pyplot(; kw::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Plots ~/.julia/packages/Plots/SVksJ/src/backends.jl:31
[13] pyplot()
@ Plots ~/.julia/packages/Plots/SVksJ/src/backends.jl:31
[14] top-level scope
@ In[2]:1
[15] eval
@ ./boot.jl:360 [inlined]
[16] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1094
I have tried removing my conda installation and reinstalling with the same packages, but I keep getting these errors.