Install PIL with Jpeg support on Ubuntu Oneiric 64bit

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 figure out how to solve this one.

I could not get PIL to compile with JPEG, Zlib or freetype support on my virtualenv. I am using Ubuntu Oneiric Beta1 on a Lenovo Thinkpad X220. That is a 64bit installation.

As read in every blog post out 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, your regular pip install PIL should work under most situations. In my case I was still seeing this summary after the installation:

    ---------------------------------------------------------------
    *** TKINTER support not available
    --- JPEG support not available
    --- ZLIB (PNG/ZIP) support not available
    --- FREETYPE2 support not available
    *** LITTLECMS support not available
    ---------------------------------------------------------------

After a lot of googling around, I found this solution on Ubuntu forums.
It turns out that the APT installations put the libraries under /usr/lib/x86_64-Linux-gnu and PIL will search for them in /usr/lib/. So you have 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 /usr/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 uname -i that prints the box’s arquitecture. This is a much more generic solution!

How to do it on Ubuntu Precise Pagolin 12.04

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

后来根据http://effbot.org/downloads/#Imaging PIL源码安装包中的README方法解决更方便:

sudo apt-get install libjpeg62-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install liblcms1-dev   
时间: 2024-10-05 05:58:04

Install PIL with Jpeg support on Ubuntu Oneiric 64bit的相关文章

Install PIL with Jpeg support on Raspbian Jessie

参考: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=79379 在 树莓派(Raspbian Jessie) 上安装django-oscar时,使用如下命令无法安装成功Pillow sudo pip install pillow 解决 sudo apt-get install python-pil

解决python的pip install PIL失败问题

安装PIL的时候遇到个问题, pip install PIL Downloading/unpacking PIL   Could not find any downloads that satisfy the requirement PIL   Some externally hosted files were ignored (use --allow-external PIL to allow). Cleaning up... No distributions at all found for

[zz]Python 3.4 and Pillow 2.4 with JPEG2000 (openjpeg 2) support in Ubuntu 14.04

Pillow support for JPEG2000 comes from openjpeg 2 library. Unfortunatly, Ubuntu's libopenjpeg2 package is not version 2 of the openjpeg library, but actually version 1.3 which wont work with Pillow. Installing Pillow 2.4 (pip install -I pillow) simpl

【转】install intel wireless 3165 driver for ubuntu 14.04.3

[转]install intel wireless 3165 driver for ubuntu 14.04.3 Ubuntu 14.04.3 with 3.19 kernel can’t drive the new Intel Wireless 3165 AC with firmware version 13.This is about how to install the driver mannually. Today I changed a new Dell vastro 5000 ser

Install Redmine 3.2.0 on Ubuntu 14.04

To install redmine 3.2.0 on Ubuntu 14.04, mainly follow the tutorial: HowTo Install Redmine 3.0.x on Ubuntu 14.04 with Apache2, Phusion Passenger, MySQL, Subversion and Git (Gitolite) During the install process, some problems are encountered. The res

install the Mondo Rescue utility in Ubuntu 12.04 or 12.10.

  1. Open a terminal window. 2. Type in the following commands, then hit Enter after each. wget ftp://ftp.mondorescue.org/ubuntu/`lsb_release -r|awk '{print $2}'`/mondorescue.sources.listsudo sh -c "cat mondorescue.sources.list >> /etc/apt/sour

Install 32bit libraries in 64 bit ubuntu(14.10)

*/--> Install 32bit libraries in 64 bit ubuntu(14.10) I downloaded lingo11 (which is a cracked version,32bit), and when I was trying to run that program in 64 bit ubuntu, the bash complained that the target exection file did not exist. And I realized

How to install Freemind 1.0.1 to Ubuntu 14

安装了Freemind0.9后发现不能打开windows的1.0.1保存的*.mm文件,便对版本开始升级. 1. 从http://freemind.sourceforge.net/wiki/index.php/Download找到ubuntu的对应版本下载http://www.getdeb.net/app/Freemind  (1.0.1) 2. 使用Ubuntu Software Center 安装这个deb文件的时候发现需要一些包但是这些依赖包不被信任.于是用apt-get install

install java 7 or 8 on Ubuntu

ubuntu 安装jdk 的两种方式: 1:通过ppa(源) 方式安装. 2:通过官网下载安装包安装. 这里推荐第1种,因为可以通过 apt-get upgrade 方式方便获得jdk的升级 使用ppa/源方式安装 1.添加ppa sudo add-apt-repository ppa:webupd8team/java sudo apt-get update 2.安装oracle-java-installer jdk7 sudo apt-get install oracle-java7-inst