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,170 points
2,735 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,160 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,720 points
1,565 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,870 points
253 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 12, 2019 in Python by Mark
2,745 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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,032 views
0 votes
0 answers
+4 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,810 points
1,554 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,160 points
1,794 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,160 points
1,152 views