ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (unknown location)

0 votes

I tried to import one image using PIL library, but I got this error while importing Image.

from PIL import Image
Traceback (most recent call last):
  File "<ipython-input-13-b7f01c2f8cfe>", line 1, in <module>
    from PIL import Image
  File "/lib/python3.7/site-packages/PIL/Image.py", line 40, in <module>
    from . import PILLOW_VERSION, ImageMode, TiffTags, __version__, _plugins
ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (unknown location)

How can I solve this?

Apr 22 in Python by akhtar
• 10,580 points
301 views

1 answer to this question.

0 votes

Hi@akhtar,

I think there is a problem in the version. So, try to reinstall your PILLOW module.

$ pip install pillow

If you get the same error, then follow the below steps.

import sys
print(sys.path)
sys.path.append('/lib/python3.7/site-packages')
from PIL import Image

answered Apr 22 by MD
• 23,050 points

Related Questions In Python

0 votes
1 answer

How to resolve ImportError: cannot import name 'add' in python ?

There's no module called "add" in random. ...READ MORE

answered Feb 12, 2019 in Python by Mark
1,770 views
0 votes
1 answer

Google PubSub Subscription cannot recover from StatusCode.UNAVAILABLE [code=8a75] error

I'm seeing similar behavior as you. Except ...READ MORE

answered Oct 5, 2018 in Python by Priyaj
• 57,530 points
330 views
0 votes
0 answers

What is the difference between import module and from module import?

When both serves the same purpose, why ...READ MORE

May 22, 2019 in Python by Waseem
• 4,530 points
136 views
0 votes
1 answer
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 947 views
0 votes
0 answers
+4 votes
6 answers
0 votes
1 answer

ImportError: cannot import name 'main' in pip

Hi@akhtar, To avoid this error, you should upgrade ...READ MORE

answered Apr 15 in Python by MD
• 23,050 points
186 views
0 votes
1 answer

ImportError: cannot import name 'appdirs'

Hi@akhtar, I think you missed some module to ...READ MORE

answered May 5 in Python by MD
• 23,050 points
110 views