Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'PIL'

I'm running into an error where when I try

from PIL import Image, ImageFilter

in a Python file I get an error stating ModuleNotFoundError: No module named 'PIL'.

So far I've tried uninstalling/reinstalling both PIL and Pillow, along with just doing import Image, but the error keeps on occurring and I have no idea why. All the solutions I've found so far have had no effect on my issue.

I'm running Python 3.5 on Ubuntu 16.04

like image 878
HF1 Avatar asked Sep 12 '25 17:09

HF1


1 Answers

Had the same problem before and I tried:

pip install pillow 
pip install image 

import PIL --> still did not work

then I found out that it was installed as pil

c:\python36\lib\site-packages\pil

import pil

pil.__version__

'5.1.0'
like image 61
Will Avatar answered Sep 15 '25 06:09

Will