Plot function not working -- Getting installation and PyPlot error

168 views
Skip to first unread message

ssarkaray...@gmail.com

unread,
Oct 27, 2015, 4:02:05 AM10/27/15
to julia-dev
Hello,

I tried following steps to install and use PyPlot :

D900C:~/julia$ sudo apt-get install matplotlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package matplotlib
sarkar@sarkar-D900C:~/julia$ 
sarkar@sarkar-D900C:~/julia$ sudo apt-get install python-matplotlib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  python-matplotlib-data python-numpy python-pyparsing python-support python-tz
Suggested packages:
  dvipng ipython python-configobj python-excelerator python-matplotlib-doc python-qt3 python-qt4 python-scipy python-traits
  python-wxgtk2.8 texlive-extra-utils texlive-latex-extra python-numpy-doc python-numpy-dbg python-nose python-dev gfortran
The following NEW packages will be installed:
  python-matplotlib python-matplotlib-data python-numpy python-pyparsing python-support python-tz
0 upgraded, 6 newly installed, 0 to remove and 640 not upgraded.
Need to get 0 B/6,238 kB of archives.
After this operation, 23.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Selecting previously unselected package python-matplotlib-data.
(Reading database ... 150024 files and directories currently installed.)
Unpacking python-matplotlib-data (from .../python-matplotlib-data_1.1.1~rc1+git20120423-0ubuntu1_all.deb) ...
Selecting previously unselected package python-pyparsing.
Unpacking python-pyparsing (from .../python-pyparsing_1.5.2-2ubuntu1_all.deb) ...
Selecting previously unselected package python-tz.
Unpacking python-tz (from .../python-tz_2011k-0ubuntu5.1_all.deb) ...
Selecting previously unselected package python-numpy.
Unpacking python-numpy (from .../python-numpy_1%3a1.6.1-6ubuntu1_amd64.deb) ...
Selecting previously unselected package python-support.
Unpacking python-support (from .../python-support_1.0.14ubuntu2_all.deb) ...
Selecting previously unselected package python-matplotlib.
Unpacking python-matplotlib (from .../python-matplotlib_1.1.1~rc1+git20120423-0ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up python-matplotlib-data (1.1.1~rc1+git20120423-0ubuntu1) ...
Setting up python-pyparsing (1.5.2-2ubuntu1) ...
Setting up python-tz (2011k-0ubuntu5.1) ...
Setting up python-numpy (1:1.6.1-6ubuntu1) ...
Setting up python-support (1.0.14ubuntu2) ...
Setting up python-matplotlib (1.1.1~rc1+git20120423-0ubuntu1) ...
Processing triggers for python-support ...
sarkar@sarkar-D900C:~/julia$ 
sarkar@sarkar-D900C:~/julia$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0 (2015-10-08 06:20 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/                   |  x86_64-linux-gnu

julia> using PyPlot
INFO: Installing matplotlib via the Conda package...
Fetching package metadata: ....
Solving package specifications: ......................
# All requested packages already installed.
# packages in environment at /home/sarkar/.julia/v0.4/Conda/deps/usr:
#
matplotlib                1.4.3               np110py27_2  
ERROR: InitError: PyError (:PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('cannot import name scimath',)
  File "/home/sarkar/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/__init__.py", line 180, in <module>
    from matplotlib.cbook import is_string_like
  File "/home/sarkar/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/matplotlib/cbook.py", line 33, in <module>
    import numpy as np
  File "/home/sarkar/.julia/v0.4/Conda/deps/usr/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/home/sarkar/.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/sarkar/.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/sarkar/.julia/v0.4/PyCall/src/exception.jl:81
 in pyimport at /home/sarkar/.julia/v0.4/PyCall/src/PyCall.jl:79
 in __init__ at /home/sarkar/.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

julia> 

Can I please get some help what should I do next ?  I was always getting error for Plot function.

Thanks,
SS

Tony Kelman

unread,
Oct 27, 2015, 5:39:28 AM10/27/15
to julia-dev
Are your packages all up to date? Does Pkg.status() show any local modifications? This sounds like https://github.com/stevengj/PyPlot.jl/issues/140, do any of the workarounds suggested there or in the linked PyCall issues help? Are you using the Linux tarball download of Julia?

Steven G. Johnson

unread,
Oct 31, 2015, 6:16:04 PM10/31/15
to julia-dev
See https://github.com/stevengj/PyCall.jl/issues/65

You may just have an old copy of `libopenblas.so` lying around from an earlier Julia version.
Reply all
Reply to author
Forward
0 new messages