3

I already have imageio installed:

$ pip install imageio
Requirement already satisfied: imageio in /Library/Python/2.7/site-packages
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from imageio)
Requirement already satisfied: pillow in /Library/Python/2.7/site-packages (from imageio)

Now I load a .ipynb file with Jupyter:

$ jupyter notebook 1_notmnist.ipynb

got error:

ImportError: No module named imageio

I thought it has something to do with Can't load Python modules installed via pip from site-packages directory, and follow exactly as the answer suggest to reinstall imageio:

$ python -m pip install imageio

and still no help.

How do I install imageio that enable Jupyter load it?

update:

Terminal: $ which python

/usr/bin/python

Jupyter:

$ import sys
print sys.executable

/usr/local/opt/python/bin/python2.7

Rahn
  • 4,001
  • 2
  • 20
  • 45

3 Answers3

5

You can install module by jupter notebook, just paste:

!pip install imageio

In your notebook, then it will be work.

Could be that you install it on python2 and it is not available on jupyter, or you are using virtual env.


Update: If you will add

%load_ext autoreload
%autoreload 2

to your notebook then your notebook will be see installed packages (you should import it without an error).

CezarySzulc
  • 1,486
  • 1
  • 10
  • 22
1

When I got a similar error with Jupyter Notebook and Mac OS, I ran the following in Terminal:

sudo conda install imageio

tonethar
  • 1,912
  • 23
  • 27
0

python2.7 might already be on the PATH, but if not you can do

/usr/local/opt/python/bin/python2.7 -m pip install imageio 

Or you can install a Jupyter kernel for your system's Python

OneCricketeer
  • 126,858
  • 14
  • 92
  • 185