from PIL import ImageTk, Image code example

Example 1: ImportError: cannot import name 'ImageTK'

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

Example 2: what is imageTk in pil python

The ImageTk module contains support to create 
and modify Tkinter BitmapImage and PhotoImage objects 
from PIL images. ... This can be used everywhere Tkinter expects an image object. The given image must have mode “1”.

Example 3: ImportError: cannot import name 'ImageTk'

# python 2
sudo apt-get install python-imaging python-pil.imagetk

# python 3
sudo apt-get install python3-pil python3-pil.imagetk

Example 4: mportError: cannot import name 'ImageTK' from 'PIL'

from PIL import Image, ImageTk

Tags:

Misc Example