如何安装PIL--*** TKINTER support not available---IOError: cannot identify image file
来源:互联网 发布:js酷炫特效 编辑:程序博客网 时间:2024/05/21 21:45
问题一: *** TKINTER support not available
PIL 1.1.7 SETUP SUMMARY--------------------------------------------------------------------version 1.1.7platform linux2 2.7.6 (default, Nov 11 2014, 16:55:01) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]--------------------------------------------------------------------*** TKINTER support not available--- JPEG support available--- ZLIB (PNG/ZIP) support available--- FREETYPE2 support available--- LITTLECMS support available--------------------------------------------------------------------To add a missing option, make sure you have the requiredlibrary, and set the corresponding ROOT variable in thesetup.py script.
解决:
apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev (无用)
pip install pillow
问题二:如何安装PIL
原文见:http://cn-popeye.iteye.com/blog/1236691
转载如下:
PIL是python理想的图片处理module,但是想要良好的支持各种图片,还需要检查一下几步,否则会提示:IOError: decoder jpeg not available之类的。
我的环境:Linux mint 11 amd64 / Python2.7
第一步:安装zlib png freetype jpeg
- install zlib (ubuntu 官方源没有zlib,别想apt-get了)
下载zlib,(zlib.net已墙,可以去SF.net),
url: http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib-1.2.5.tar.gz/download?use_mirror=superb-dca2
shell:
- install png(忘记apt-get吧)
- install freetype (忘记apt-get吧)
shell:
- install jpeg (忘记apt-get吧)
shell:
第二步:安装需要的 devel库(现在是想起apt-get的时候了)
第三步:安装 PIL( Python Imaging Library )
检查是否支持:
正式安装:
最后一步:验证
- #!/usr/bin/env python
- # -*- coding:utf-8 -*-
- import Image
- picPath = '~/images/1212.jpg'
- im = Image.open(picPath)
- print im.getbbox()
问题三:ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory
解决:
<span style="font-size:18px;">whereis Python export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/lampp/lib/ </span>
问题四:PIL IOError: cannot identify image file 'images/1212.jpg'的解决办法
from PIL import Image
instead of
import Image
fixed the issue
最后,贴上我的测试和结果:
aa.py:
#!/usr/bin/env python# -*- coding:utf-8 -*-#import Image#import ImageFontfrom PIL import ImagepicPath = 'images/1212.jpg'im = Image.open(picPath)print im.getbbox()
结果:
(0, 0, 451, 182)
- 如何安装PIL--*** TKINTER support not available---IOError: cannot identify image file
- python IOError: cannot identify image file
- python IOError: cannot identify image file
- PIL IOError: cannot identify image file 'images/1212.jpg'的解决办法
- Python代码调试问题:IOError: cannot identify image file
- PIL IOError: decoder jpeg not available
- python PIL IOError: decoder jpeg not available
- scrapy爬虫之错误 No module named PIL + IOError:decoder jpeg not available +PIL的安装
- Image.open() cannot identify image file
- 修正pil错误 IOError: decoder zip not available
- PIL不能正常使用exceptions.IOError: decoder jpeg not available
- PIL image 提示 decoder jpeg not available
- ImportError: No module named Image IOError: decoder zip not available
- python(django) 使用PIL报错IOError at decoder jpeg not available
- python 使用PIL报错IOError at decoder jpeg not available
- python(django) 使用PIL报错IOError at decoder jpeg not available
- 出现“cannot identify image file '/Users//.DS_Store'”问题解决的办法
- PIL IOError: cannot open resource处理
- spring源代码分析转载
- Avro通过schema自动生成java代码
- 使用Java处理除法运算的陷阱
- [小技巧] Linux下判断一个线程是否为内核线程
- 享元模式
- 如何安装PIL--*** TKINTER support not available---IOError: cannot identify image file
- 在iOS8系统下,UITabbar上的item自定义背景色和图片问题 (
- TreeSet排序
- IOS编程之相机和相册
- jsp页面的div层的弹出效果
- Delphi xe7并行编程快速入门
- 移位运算的算法
- 模板之Typelist的"增删改查"
- MySQL随堂笔记| 深度结合个人理解