I want to install PIL in python, but it seems I can't install the module correctly, is there anything that can solve the problem? (My python version is 2.7)
-
Update `pip` and consider using [Pillow](https://pypi.python.org/pypi/Pillow) instead of PIL. – Matthias May 19 '16 at 07:21
-
Check this link http://stackoverflow.com/a/20061019/524743 – Samuel May 19 '16 at 07:23
3 Answers
Try installing Pillow, I was facing the same problem and then I figured out that PIL can be installed using the following.
pip install Pillow

- 1,414
- 1
- 14
- 22
-
1technically it's Pillow, not PIL. Pillow forked from PIL, which is no longer being maintained, iirc. – Marcel Wilson May 19 '16 at 17:43
Find your Python path:
which python
/Users/gogasca/anaconda/bin/python
You can install it from IDE itself or Project Settings:
Settings | Project | Project Interpreter | Select the right path, Click + and add pil Library
You can install from there. For me 1.1.7 worked in Pycharm 5.0.4 in OSX Python 2.7.10. Other alternatives is via CLI or Pillow
or from within pycharm terminal "pip install pillow"
if you get something like:
Traceback (most recent call last): File "C:\Users\user\AppData\Local\Temp\pip-install-owgbzt7s\Pil low\setup.
or
Traceback (most recent call last): File "", line 1, in File "C:\Users\user\AppData\Local\Temp\pip-install-owgbzt7s\Pil low\setup.py", line 907, in raise RequiredDependencyException(msg) __main__.RequiredDependencyException:
while installing Pillow , then there is some problem with your pip. the version creating this issue are pip 19.xx.xx and Pillow 7.0.0
Solution(worked for me)
For PyCharm:
Go to settings > Project: (your project name) > Project Interpreter.
Double click on pip, check specify version which should be 20.0.2+ and click on "Install Package". This will reinstall pip for you.
Now either search for Pillow in same window and click on install or use
python -m pip install Pillow
in terminal of PyCharm.
For non PyCharm or Terminal Users:
uninstall pip
apt-get remove --purge python-pip
install pip
curl https://bootstrap.pypa.io/get-pip.py | sudo python

- 1
- 1