Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StopIteration: Could not import PIL.Image. The use of `array_to_img` requires PIL

I get this error while running a keras code, so keras is trying to import

from PIL import Image as pil_image

I have installed pillow, also I'm able to successfully import this in my python terminal but in jupyter notebook it gives import error.

env - ubuntu 16 on aws ec2 instance, I'm using aws deep learning ami for ubuntu

pillow comes with conda, I also tried to install using pip

but again I can import it in python/ipython shell but not in jupyter notebook.

like image 999
RISHAV KUMAR Avatar asked Nov 26 '17 16:11

RISHAV KUMAR


1 Answers

I had opencv installed. But I just installed pillow(keeping opencv) and it worked for me.

like image 148
Aniket Rangrej Avatar answered Nov 15 '22 02:11

Aniket Rangrej