Install Python Image Library (PIL) on Ubuntu

Something that probably shouldn't cause me so many problems is.

I am trying to install PIL on my Ubuntu server. It sets perfectly. However, every time I try to update the database to add an image field, I get the following error:

Error: one or more models did not confirm: product.product: "image": in order to use ImageFields you need to install the Python image library. Get it http://www.pythonware.com/products/pil/ .

I just realized that I was logged in as my user. Do I need to register as root to install it? I am doing this on a VPS, not a local machine.

I have tried many tutorials on the Internet and will not go anywhere.

+6
source share
3 answers

I had to install python-dev, then install PIL inside my virtualenv.

Now everything works.

Thanks for your help!:)

+21
source

If you are not a root user, you must install python-imaging to enter the following command:

sudo apt-get install python-imaging 

Or (if you are root), the following command (without sudo) will install python-imaging

 apt-get install python-imaging 
+4
source

Ideally, you should use virtualenv and pip install pil there ... If you have access and want to use packages with a system network, you need to raise it to the root (sudo) to easy_install or pip install.

Make sure your server (Django?) Is rebooted so that it can build new libraries. (The interpreter does not always seem to pick up newly installed modules during operation).

0
source

Source: https://habr.com/ru/post/920591/


All Articles