Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install a package that enable Jupyter load it?

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

like image 769
Rahn Avatar asked Mar 07 '23 21:03

Rahn


1 Answers

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).

like image 82
CezarySzulc Avatar answered Mar 19 '23 14:03

CezarySzulc