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, 2020 in Python by akhtar
• 38,260 points
7,556 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, 2020 by MD
• 95,460 points

Related Questions In Python

0 votes
1 answer

ImportError: cannot import name 'render_to_response' from 'django.shortcuts'

Hello @kartik, The render_to_response shortcut was deprecated in Django 2.0, and ...READ MORE

answered Jul 2, 2020 in Python by Niroj
• 82,840 points
8,628 views
0 votes
1 answer

ImportError: cannot import name 'API_KEY' from 'forwarder'

The AWS package in PyPI is not AWS's official ...READ MORE

answered Nov 6, 2020 in Python by Gitika
• 65,770 points
2,620 views
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 13, 2019 in Python by Mark
4,711 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

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

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,125 views
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, 2020 in Python by MD
• 95,460 points
4,983 views
+1 vote
1 answer

ImportError: cannot import name 'appdirs'

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

answered May 5, 2020 in Python by MD
• 95,460 points
3,994 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP