Install PIL with Jpeg support on Ubuntu Oneiric 64bit
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Install PIL with Jpeg support on Ubuntu Oneiric 64bit,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2633字,纯文字阅读大概需要4分钟。
内容图文
![Install PIL with Jpeg support on Ubuntu Oneiric 64bit](/upload/InfoBanner/zyjiaocheng/1066/cf5331a50059428da04052da4e20bdab.jpg)
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
原文:http://www.cnblogs.com/dhcn/p/7105597.html
内容总结
以上是互联网集市为您收集整理的Install PIL with Jpeg support on Ubuntu Oneiric 64bit全部内容,希望文章能够帮你解决Install PIL with Jpeg support on Ubuntu Oneiric 64bit所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。