Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda python, PIL and imagingtk

Although this is a reasonably well documented problem, I can't find a solution.

I cannot import PIL and ImageTK.

Minimal example:

import Tkinter as tk
from PIL import Image, ImageTk

root = tk.Tk()
image = Image.open('live.ppm')
photo = ImageTk.PhotoImage(image)

This produces the error:

File "C:\Anaconda\lib\site-packages\PIL\ImageTk.py", line 181, in paste
    import _imagingtk
ImportError: No module named _imagingtk

I have tried:

conda install pillow
conda remove PIL

But no luck.

like image 857
user2290362 Avatar asked Feb 18 '15 16:02

user2290362


1 Answers

After uninstalling pillow and PIL:

pip install image

Fixed this issue.

like image 198
user2290362 Avatar answered Oct 11 '22 14:10

user2290362