Hi,
I am getting errors when using PyPlot and Gtk together:
julia> using PyPlot, Gtk
ERROR: InitError: could not load library "/Users/hyzhou/.julia/artifacts/c6f53b0adfb48f611ad41b73461d9419117d3503/lib/libfontconfig.1.dylib"
dlopen(/Users/hyzhou/.julia/artifacts/c6f53b0adfb48f611ad41b73461d9419117d3503/lib/libfontconfig.1.dylib, 1): Library not loaded: @rpath/libfreetype.6.dylib
Referenced from: /Users/hyzhou/.julia/artifacts/c6f53b0adfb48f611ad41b73461d9419117d3503/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 24.0.0 or later, but libfreetype.6.dylib provides version 23.0.0
Stacktrace:
[1] #dlopen#3(::Bool, ::typeof(Libdl.dlopen), ::String, ::UInt32) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109
[2] dlopen at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Libdl/src/Libdl.jl:109 [inlined] (repeats 2 times)
[3] __init__() at /Users/hyzhou/.julia/packages/Fontconfig_jll/bvmOQ/src/wrappers/x86_64-apple-darwin14.jl:358
[4] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:692
[5] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:776
[6] _tryrequire_from_serialized(::Base.PkgId, ::UInt64, ::String) at ./loading.jl:707
[7] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:765
[8] _require(::Base.PkgId) at ./loading.jl:1001
[9] require(::Base.PkgId) at ./loading.jl:922
[10] require(::Module, ::Symbol) at ./loading.jl:917
during initialization of module Fontconfig_jll
However, if I switch the import order,
julia> using Gtk, PyPlot
[ Info: Installing pyqt package to avoid buggy tkagg backend.
┌ Warning: No working GUI backend found for matplotlib
└ @ PyPlot ~/.julia/packages/PyPlot/4wzW1/src/init.jl:165
ERROR: InitError: PyError (PyImport_ImportModule
The Python package matplotlib.pyplot could not be found 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/hyzhou/.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/hyzhou/.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 52.0.0 or later, but libpng16.16.37.0.dylib provides version 16.0.0')
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 32, in <module>
import matplotlib.colorbar
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/colorbar.py", line 32, in <module>
import matplotlib.contour as contour
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/contour.py", line 19, in <module>
import matplotlib.text as text
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/text.py", line 18, in <module>
from .textpath import TextPath # Unused, but imported by others.
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/textpath.py", line 12, in <module>
from matplotlib.mathtext import MathTextParser
File "/Users/hyzhou/.julia/conda/3/lib/python3.7/site-packages/matplotlib/mathtext.py", line 34, in <module>
from matplotlib import _png, cbook, colors as mcolors, get_data_path, rcParams
Stacktrace:
[1] pyimport(::String) at /Users/hyzhou/.julia/packages/PyCall/kAhnQ/src/PyCall.jl:536
[2] __init__() at /Users/hyzhou/.julia/packages/PyPlot/4wzW1/src/init.jl:195
[3] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:692
[4] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:776
[5] _require(::Base.PkgId) at ./loading.jl:1001
[6] require(::Base.PkgId) at ./loading.jl:922
[7] require(::Module, ::Symbol) at ./loading.jl:917
during initialization of module PyPlot
I am wondering what is causing this behind the scene.