Installing and using matplotlib, and loading MNIST data

220 views
Skip to first unread message

Martin Isaksson

unread,
Nov 6, 2017, 5:09:44 PM11/6/17
to Hops
Hi,

a bit late now, so this is probably a post I will want to have deleted....

I am trying to use matplotlib. First I installed the latest version via the web interface, and it reports installed. When I try to use it in the notebook I get an ImportError. Running "pip freeze | grep matplotlib" in a cell tells me I have version 1.2.0 installed.

No module named matplotlib.pyplot
Traceback (most recent call last):
ImportError: No module named matplotlib.pyplot

I then ran `pip install --user matplotlib==2.1.0` in a cell which seems to do the trick... until I try to import a module, specifially "from tensorflow.examples.tutorials.mnist import input_data" which gives me the following error:

~~~~
/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/_path.so)
Traceback (most recent call last):
File "/srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "/srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "/srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/artist.py", line 16, in <module>
from .path import Path
File "/srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/path.py", line 25, in <module>
from . import _path, rcParams
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /srv/hops/anaconda/anaconda/envs/MNIST/lib/python2.7/site-packages/matplotlib/_path.so)
~~~

What am I missing?

Thanks!
/M

Jim Dowling

unread,
Nov 7, 2017, 1:31:47 AM11/7/17
to Martin Isaksson, Hops
In the web interface, if you click on the "Settings" button, you will
see a way to install conda libraries. We suport conda, not pip
(because of these types of problems with pip).
Are you using Zeppelin or Jupyter?

If you want to use matplotlib from Zeppelin and PySpark, here's a guide:
https://gist.github.com/andershammar/9070e0f6916a0fbda7a5

If you're using Jupyter - what "kernel" are you using - PySpark or Python?
How you use matplotlib depends on whether your kernel is
'<projname>-python' or 'pyspark'
> --
> You received this message because you are subscribed to the Google Groups "Hops" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hopshadoop+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hopshadoop/1b17e370-db4c-48be-bfb4-483889d9d70a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
________________________________________________
Dr. Jim Dowling
http://www.jimdowling.info
email: dowli...@gmail.com
phone: +46 73 2505883

Martin Isaksson

unread,
Nov 7, 2017, 3:15:03 AM11/7/17
to Hops
Hi,

I have used the web interface as you described to install Matplotlib. I tried a few versions, but let's say 2.1.0 
Tensorflow 1.3.0 was already installed, (using pip it says). Btw, I couldn't run "conda list" in a cell, didn't spend any time on finding out how I could.

I am using the PySpark Jupyter kernel, I have only "PySpark", "SparkR" and "Spark" kernels in the list ... This means that when I load a module, I get a spark context without asking :)

/M
Reply all
Reply to author
Forward
0 new messages