PyPlot.jl icon indicating copy to clipboard operation
PyPlot.jl copied to clipboard

Cannot use Both ProfileView and PyPlot

Open UserQuestions opened this issue 7 years ago • 0 comments

When I start ProfileView first and then PyPlot using the :qt backend as suggested here, I get the following error:

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("/lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/../../../libpng16.so.16)")
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 31, in <module>
    import matplotlib.colorbar
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/colorbar.py", line 36, in <module>
    import matplotlib.contour as contour
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/contour.py", line 21, in <module>
    import matplotlib.text as text
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/text.py", line 22, in <module>
    from .textpath import TextPath  # Unused, but imported by others.
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/textpath.py", line 20, in <module>
    from matplotlib.mathtext import MathTextParser
  File "/home/.julia/packages/Conda/m7vem/deps/usr/lib/python3.7/site-packages/matplotlib/mathtext.py", line 38, in <module>
    from matplotlib import _png, colors as mcolors, get_data_path, rcParams

Stacktrace:
 [1] pyimport(::String) at /home/.julia/packages/PyCall/rUul9/src/PyCall.jl:486
 [2] __init__() at /home/.julia/packages/PyPlot/fZuOQ/src/init.jl:187
 [3] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:627
 [4] macro expansion at ./logging.jl:312 [inlined]
 [5] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:698
 [6] _require(::Base.PkgId) at ./loading.jl:931
 [7] require(::Base.PkgId) at ./loading.jl:852
 [8] macro expansion at ./logging.jl:311 [inlined]
 [9] require(::Module, ::Symbol) at ./loading.jl:834
during initialization of module PyPlot

When I haven't used ProfileView first, I don't get similar issues. Also, if I load PyPlot first, ProfileView hangs when I try to use it.

UserQuestions avatar Sep 08 '18 17:09 UserQuestions