简体   繁体   中英

Django - how to Install Python Image Library (PIL)

I want to use the ImageField for forms and according to the documentation, it said I need to install the Python Imaging Library:

http://www.pythonware.com/products/pil/

It says that the current free version is PIL 1.1.7, so I decided to go for that. I am using Lubuntu (Linux) and the only Non-WindowsOnly installation is the

Python Imaging Library 1.1.7 Source Kit

so I decided to click and install that .tar.gz file. I know have the Imaging-1.1.7.tar.gz file in my downloads folder. Can someone tell me / show me a site which explains how I can now link it with Django? Where should I extract the file?

How about Pillow: http://pillow.readthedocs.org/en/latest/

It is a fork of PIL, and Django supports if from 1.6, and prefers it over PIL. https://code.djangoproject.com/ticket/19934

pip install Pillow

Edit:

As @miki725 noted, it was working even before 1.6, but it has been "officially" supported since.

source: https://pypi.org/project/Pillow/2.2.1/

pip install Pillow

Pillow is the “friendly” PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM