Ubuntu Tkinter installation does not include PyImagingPhoto
So after posting an issue on GitHub I was told I was missing some libraries.
Specifically I needed to
sudo apt-get install tk8.5-dev tcl8.5-dev
and then
pip install -I pillow
to rebuild pillow. This worked on my raspberry pi running rasbian
I struggled with this for a long time. None of these solutions worked for me, other people were hostile claiming the problem had already been solved while pointing to python2.7 instead of python3 or that I must not be following the instructions. But on Ubuntu with more than one computer, I had this problem and here's how I finally solved it:
sudo apt-get purge python3-pil;sudo apt-get install python3-pil python3-pil.imagetk
So basically the apt version of turning it off and turning it on again. :/
I don't have the rep to comment, so I'll answer instead
I too was getting the error can't from PIL import _imagingtk
using python3 on Linux Mint 17when trying to do a tk_im = ImageTk(im)
First I installed the tk8.6-dev and tcl8.6-dev as suggested above
Then I tried the pip3 --upgrade route
, which didn't fix the problem
If I imported PIL in a shell, PIL.PILLOW_VERSION was 2.7.0. Using pip3 list however, it claimed to be 2.3.0.
so I did sudo pip3 uninstall pillow
, followed bysudo pip3 install pillow
Now, both methods of reading the version return 2.7.0and the program works!
When/how I caught pillow 2.3, why it wouldn't upgrade with pip, and why it showed as 2.7 in the python shell I don't know, but the uninstall/install fixed it.