I use this command in the shell to install PIL:
easy_install PIL
then I run python
and type this: import PIL
. But I get this error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named PIL
I've never had such problem, what do you think?
On a different note, I can highly recommend the use of Pillow which is backwards compatible with PIL and is better maintained/will work on newer systems.
When that is installed you can do
or
etc..
I had the same issue while importing PIL and further importing the ImageTk and Image modules. I also tried installing PIL directly through pip. but not success could be achieved. As in between it has been suggested that PIL has been deprectaed, thus, tried to install pillow through pip only. pillow was successfully installed, further, the PIL package was made under the path : python27/Lib/site-packages/.
Now both Image and ImageTk could be imported.
I used conda-forge to install pillow version 5, and that seemed to work for me:
the normal conda install pillow did NOT work for me.
You will need to install Image and pillow with your python package. Rest assured, the command line will take care of everything for you.
Hit
python -m pip install image
You are probably missing the python headers to build pil. If you're using ubuntu or the likes it'll be something like
In shell, run:
Attention: PIL is deprecated, and pillow is the successor.