Ubuntu Installation Guide for Python Imaging Library (PIL)

The problem is caused by the following code. The error is a result of the code mentioned above. I have confirmed that the tesseract module is installed. I believe I have obtained all the necessary packages, but unfortunately I am stuck at this point. For Windows, follow the steps below for installation of tessaract-ocr required. Refer to this link: https://github.com/Tesseract-OCR/tesseract/wiki, otherwise you will encounter the error “Tessract is not on path”. Python code is used for this solution. Here is what works for me: After installing the pytesseract from tesseract-ocr-setup-3.05.02-20180621.exe, I add the mentioned line and utilize the code provided above. I am using Windows 10 with PyCharm Community Edition 2018.2.3 x64.


I’m facing more difficulties than expected with something that should not be causing me such troubles.

I’m attempting to
install PIL
on my Ubuntu server, and the installation process is going smoothly. However, I encounter an error every time I try to update the database by including the image field. The error message I receive is as follows:

Error: Validation failure for one or more models:
product.product: “image”: To utilize ImageFields, the
Python Imaging
Library must be installed. Download it from http://www.pythonware.com/products/pil/ .

I’ve recently discovered that I’ve been logged in under my user. Is it necessary to be logged in as root in order to install it? I’m performing this task on a VPS rather than a local machine.

Despite attempting numerous online tutorials, I am not making any progress.

Solution 1:

In order to set up my virtualenv, I had to
install python
then proceed with installing PIL.

All working now.

Thanks for your help all! 🙂

Solution 2:

To install
, enter the following command only if you are not a root user.

sudo apt-get install python-imaging

Rephrased MSDTHOT:”””
If you have root access, you can install python-imaging by running the following command without sudo.

apt-get install python-imaging

Solution 3:

Ideally, you should be using both



pip install pil

in that situation. If you have access and wish to utilize system-wide packages, you must elevate to root (sudo) for either





Ensure that you reboot your server (Django?) in order for it to recognize the updated libraries. It appears that the interpreter may not always detect newly installed modules while it is running.

Frequently Asked Questions