首页 > 编程语言 > 详细

ubuntu Python2.7 安装PIL问题

时间:2014-07-06 13:46:06      阅读:575      评论:0      收藏:0      [点我收藏+]
$sudo easy_install PIL
WARNING: ‘‘ not a valid package name; please use only.-separated package names in setup.py
_imaging.c:75:20: fatal error: Python.h: 没有那个文件或目录
 #include "Python.h"
                    ^
compilation terminated.
error: Setup script exited with error: command x86_64-linux-gnu-gcc failed with exit status 1

通过easy_install 安装PIL提示以上错误,解决方法:

$ sudo apt-get install python-dev

再次安装PIL成功。

测试:将一个图片生成缩略图:

#!/usr/bin/env python

from PIL import Image

im = Image.open(test.jpg)

print im.format, im.size, im.mode


im.thumbnail((120,120))


im.save(thumb.jpg, JPEG)

 

 

ubuntu Python2.7 安装PIL问题,布布扣,bubuko.com

ubuntu Python2.7 安装PIL问题

原文:http://www.cnblogs.com/yshyee/p/3825732.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!