Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError("No module named 'matplotlib'",) #28

Open
hellolj opened this issue Jan 3, 2014 · 3 comments
Open

ImportError("No module named 'matplotlib'",) #28

hellolj opened this issue Jan 3, 2014 · 3 comments

Comments

@hellolj
Copy link

hellolj commented Jan 3, 2014

I complied Julia under Archlinux. Successfully added PyPlot package, but failed in loading it:

julia> using(PyPlot)
ERROR: PyError (PyImport_ImportModule) <class 'ImportError'>
ImportError("No module named 'matplotlib'",)

 in pyerr_check at /home/hellolj/.julia/PyCall/src/exception.jl:58
 in pyimport at /home/hellolj/.julia/PyCall/src/PyCall.jl:85
 in reload_path at loading.jl:146
 in _require at loading.jl:59
 in require at loading.jl:43
while loading /home/hellolj/.julia/PyPlot/src/PyPlot.jl, in expression starting on line 32

I suspect that this error happened because under Arch Linux, ipython 2.7 is named ipython2 insteady of ipython by default on Julia side.

Can anyone help with this issue?

Thanks,

@stevengj
Copy link
Member

stevengj commented Jan 3, 2014

If you run python and then (at the Python command-line) run import matplotlib, does it work? (i.e. do you have matplotlib installed)?

In general, if you have multiple versions of Python installed on your system, you will have problems if you install matplotlib for one Python version but are running another Python version from Julia. (Julia runs python by default.)

(The ipython2 issue should be fixed in IJulia.)

@lucasb-eyer
Copy link

I can use PyPlot from IJulia with an IPython called ipython3, so I don't think it's that. Another thing you could check is using PyCall; @pyimport numpy in julia.

If by any chance you are inside a virtualenv, see JuliaPy/PyCall.jl#57.

@hellolj
Copy link
Author

hellolj commented Jan 4, 2014

Yes I had python2-matplotlib installed. It works fine with ipython2.

I have just installed both "python" and "python-matplotlib" package in Arch
Linux, which is actually based on python 3.3.3.

PyPlot now could be loaded properly. No further issue currently.

It should be the same problem as with Ijulia, both of which cannot
recognize Archlinux's ipython2 installation.

Thanks for fixing the problem with IJulia.

On Sat, Jan 4, 2014 at 3:21 AM, Steven G. Johnson
[email protected]:

If you run python and then (at the Python command-line) run import
matplotlib, does it work? (i.e. do you have matplotlib installed)?

In general, if you have multiple versions of Python installed on your
system, you will have problems if you install matplotlib for one Python
version but are running another Python version from Julia. (Julia runs
python by default.)

(The ipython2 issue should be fixed in IJulia.)


Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-31535414
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants