Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

from PIL import Image, ImageTk ImportError: cannot import name ImageTk

I am using Pycharm 2018.2.4 community edition on Ubuntu 18.04 and I have started python 2.7 project and using the IDE settings -> Project Interpreter I have installed Pillow but whenever I try:

from PIL import Image, ImageTk

I get the following error:

from PIL import Image, ImageTk ImportError: cannot import name ImageTk

how to fix this?

like image 729
mark Avatar asked Sep 13 '25 03:09

mark


2 Answers

Have you installed it correctly?

apt-get install python3-pil python3-pil.imagetk

like image 94
ErikXIII Avatar answered Sep 14 '25 18:09

ErikXIII


Just simply update your Pillow version to the latest for example PIL 7.0.0 worked for me.

like image 37
Areeb Muzaffar Avatar answered Sep 14 '25 16:09

Areeb Muzaffar