Install PIL with Jpeg support on Ubuntu oneiric 64bit

Source: Internet
Author: User
Tags virtualenv

from:http://jj.isgeek.net/2011/09/install-pil-with-jpeg-support-on-ubuntu-oneiric-64bits/

I am posting this because it took me ages to the figure out how to solve this one.

I could not get PIL to compile with JPEG, Zlib or FreeType in my virtualenv. I am using Ubuntu oneiric Beta1 on a Lenovo Thinkpad X220. That's a 64bit installation.

As read in every blog post off there, you first need to install the system libraries so PIL can find them.

$ sudo apt-get install libjpeg libjpeg-dev libfreetype6 Libfreetype6-dev Zlib1g-dev

After that, the your regular should work under the most pip install PIL situations. In my case I am still seeing this summary after the installation:

    ---------------------------------------------------------------    * * * TKINTER support not available    ---JPEG Support does available    ---ZLIB (png/zip) support not available    ---FREETYPE2 support not available    * * * Littlec MS support Not available    ---------------------------------------------------------------

After a iot of Googling around, I found this solution on Ubuntu forums.
It turns out that the APT installations put the libraries under and /usr/lib/x86_64-Linux-gnu PIL would search for them in /usr/lib/ . So you had to create symlinks for PIL to see them.

# ln-s/usr/lib/x86_64-linux-gnu/libjpeg.so/usr/lib# ln-s/usr/lib/x86_64-linux-gnu/libfreetype.so/usr/lib# ln-s/US R/lib/x86_64-linux-gnu/libz.so/usr/lib

Now proceed and Reinstal PiL, pip install -U PIL :

    ---------------------------------------------------------------    * * * TKINTER support not available    ---JPEG Support Available    ---ZLIB (png/zip) support available    ---FREETYPE2 support available    * * LITTLECMS support Not available    ---------------------------------------------------------------

Tada!

Update:
I just had this issue again on Ubuntu precise, I found a solution here:
http://www.sandersnewmedia.com/why/2012/04/16/installing-pil-virtualenv-ubuntu-1204-precise-pangolin/

# ln-s/usr/lib/' uname-i '-linux-gnu/libfreetype.so/usr/lib/# ln-s/usr/lib/' uname-i '-linux-gnu/libjpeg.so/usr/lib/ # ln-s/usr/lib/' uname-i '-linux-gnu/libz.so/usr/lib/

Note The That uname -i prints the box ' s arquitecture. This was a much more generic solution!

How to does it on Ubuntu precise Pagolin 12.04

--------------------------------------------------------------------------------

Later, according to http://effbot.org/downloads/#Imaging PIL source installation package in the Readme method to solve more convenient:

sudo install libjpeg62-dev  sudoinstall zlib1g-dev  sudo install libfreetype6-dev  sudoinstall Liblcms1-dev   

Install PIL with Jpeg support on Ubuntu oneiric 64bit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.