Hello everyone!

I am having some trouble with PyPlot, can somebody help me?

I have Anaconda's Python 2.7 installed and normally Julia recognized it 
while using PyPlot and PyCall but it suddenly failed today while importing 
PyPlot:

ERROR: InitError: Failed to pyimport("matplotlib"): PyPlot will not work 
until you have a functioning matplotlib module.

For automated Matplotlib installation, try configuring PyCall to use the 
Conda Python distribution within Julia.  Relaunch Julia and run:
      ENV["PYTHON"]=""
      Pkg.build("PyCall")
      using PyPlot

pyimport exception was: PyError (:PyImport_ImportModule) <type 
'exceptions.ImportError'>
ImportError('/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so:
 
undefined symbol: zgelsd_',)
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/matplotlib/__init__.py", 
line 122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent, 
get_label
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/matplotlib/cbook.py", 
line 32, in <module>
    import numpy as np
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/__init__.py", line 
180, in <module>
    from . import add_newdocs
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/add_newdocs.py", 
line 13, in <module>
    from numpy.lib import add_newdoc
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/lib/__init__.py", 
line 18, in <module>
    from .polynomial import *
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/lib/polynomial.py", 
line 20, in <module>
    from numpy.linalg import eigvals, lstsq, inv
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/linalg/__init__.py", 
line 51, in <module>
    from .linalg import *
  File 
"/home/ilya/anaconda2/lib/python2.7/site-packages/numpy/linalg/linalg.py", 
line 29, in <module>
    from numpy.linalg import lapack_lite, _umath_linalg

 in __init__ at /home/ilya/.julia/v0.4/PyPlot/src/PyPlot.jl:229
 in _require_from_serialized at loading.jl:84
 in _require_from_serialized at ./loading.jl:109
 in require at ./loading.jl:219
during initialization of module PyPlot

So I tried to reinstall julia and set ENV["PYTHON"] = "" before adding 
PyCall to force the usage of Conda.jl ,
then I added PyPlot and everything seemed fine until then, but when I use 
import PyPlot I get the following error:

ERROR: InitError: PyError (:PyImport_ImportModule) <type 
'exceptions.ImportError'>
ImportError('cannot import name scimath',)
  File 
"/home/ilya/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/__init__.py",
 
line 122, in <module>
    from matplotlib.cbook import is_string_like, mplDeprecation, dedent, 
get_label
  File 
"/home/ilya/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/cbook.py",
 
line 32, in <module>
    import numpy as np
  File 
"/home/ilya/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/numpy/__init__.py",
 
line 180, in <module>
    from . import add_newdocs
  File 
"/home/ilya/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/numpy/add_newdocs.py",
 
line 13, in <module>
    from numpy.lib import add_newdoc
  File 
"/home/ilya/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/numpy/lib/__init__.py",
 
line 17, in <module>
    from . import scimath as emath

 [inlined code] from /home/ilya/.julia/v0.4/PyCall/src/exception.jl:81
 in pyimport at /home/ilya/.julia/v0.4/PyCall/src/PyCall.jl:302
 in __init__ at /home/ilya/.julia/v0.4/PyPlot/src/PyPlot.jl:227
 in _require_from_serialized at loading.jl:84
 in _require_from_serialized at ./loading.jl:109
 in require at ./loading.jl:219
during initialization of module PyPlot

I get the same error if I try to use the development branch of PyCall 
instead:
Pkg.checkout("PyCall") 
ENV["PYTHON"] = "" 

Pkg.build("PyCall")


And I get the same error when I try to use Anaconda as before by setting 
ENV["PYTHON"] = "python" and building PyCall again. (with both versions of 
PyCall)

The problem always appears when I try *using PyPlot*.

I don't know if this helps but if I try to continue and plot something I 
get the following:

ERROR: ArgumentError: haskey of NULL PyObject
 in haskey at /home/ilya/.julia/v0.4/PyCall/src/PyCall.jl:260
 in plot at /home/ilya/.julia/v0.4/PyPlot/src/PyPlot.jl:457

Any help would be highly apreciated!

Thanks,
Ilya

Reply via email to