Mac OS系统上安装Python的Pillow库的教程
1. 安装pip
sudo easy_install pip
pip 安装成功就可以直接安装pil或者pillow
2. 通过命令pip install 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 Pil Storing debug log for failure in /Users/macbook/Library/Logs/
3. 所以就安装pillow
pip install --use-wheel Pillow
Downloading/unpacking Pillow Downloading (6.5MB): 5.0MB downloaded Cleaning up...
弄了会别的'回来发现还没有下载完,这叫一个慢呀,于是放弃
4. Git
通过git下载源码地址
git clone
然后开始编译安装
4.1
python build_ext -i
编译完之后会提示运行测试例子,并且发现JPEG support not available
-------------------------------------------------------------------- version Pillow 2.4.0 platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] -------------------------------------------------------------------- --- TKINTER support available *** JPEG support not available *** OPENJPEG (JPEG2000) support not available --- ZLIB (PNG/ZIP) support available *** LIBTIFF support not available --- FREETYPE2 support available *** LITTLECMS2 support not available *** WEBP support not available *** WEBPMUX support not available -------------------------------------------------------------------- To add a missing option, make sure you have the required library, and set the corresponding ROOT variable in the script. To check the build, run the script.
4.2 因为JPEG support not available,运行python 报告错误
1 tests of 57 failed.
于是只好卸载pillow
可以通过pip命令来卸载
pip uninstall pillow sudo pip uninstall pillow
Password: Uninstalling Pillow: /Library/Python/2.7/site-packages/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ /usr/local/bin/ Proceed (y/n)? y
成功之后需要安装libjpeg的支持
brew install libjpeg
安装成功之后重新编译pillow
-------------------------------------------------------------------- version Pillow 2.4.0 platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available *** OPENJPEG (JPEG2000) support not available --- ZLIB (PNG/ZIP) support available *** LIBTIFF support not available --- FREETYPE2 support available *** LITTLECMS2 support not available *** WEBP support not available *** WEBPMUX support not available -------------------------------------------------------------------- python -------------------------------------------------------------------- Pillow 2.4.0 TEST SUMMARY -------------------------------------------------------------------- Python modules loaded from /Users/macbook/yyang/app-devel-source/python/Pillow/PIL Binary modules loaded from /Users/macbook/yyang/app-devel-source/python/Pillow/PIL -------------------------------------------------------------------- --- PIL CORE support ok --- TKINTER support ok --- JPEG support ok *** JPEG 2000 support not installed --- ZLIB (PNG/ZIP) support ok *** LIBTIFF support not installed --- FREETYPE2 support ok *** LITTLECMS2 support not installed *** WEBP support not installed -------------------------------------------------------------------- Running selftest: --- 57 tests passed.
最后执行安装
sudo python install
-
对称创意剪纸图案教程
剪纸的形式有很多,最常见的剪纸方法有:对称、折叠……等等。今天小编带来了一种对称创意剪纸图案教程,一起来欣赏一下具体的剪纸步骤,小朋友跟着教程来动手学习一下怎么剪的吧。让孩子欣赏传统剪纸艺术作品,了解我国民间剪纸文化的历史,让孩子知道剪纸的艺术特点和用...
-
彩铅画蛋糕教程图解
导语:大家喜欢吃蛋糕吗,尤其是巧克力蛋糕,一直以来都是很多人的最爱,喜欢吃甜甜的东西。以下是小编为大家分享的彩铅画蛋糕教程图解,欢迎借鉴!一、这次我们采用由上往下的画法,同样的先画出纸杯蛋糕的大致轮廓,稍后选用深哈啡色的彩铅先给顶部的巧克力上色,这里要稍...
-
简单的剪纸花教程图解
做剪纸花是剪纸手工的最常见的工艺,下面是小编为大家带来的做剪纸花步骤的图解,希望可帮助大家!简单的剪纸花教程图解做剪纸花步骤1、正方形纸对折成三角形,小编用的是之前折纸杯盖多余下来的彩纸,折成的正方形纸,如果你没有正方形的`彩纸,可以用A4纸折一下哦!做剪纸...
-
摄像机使用技巧教程
摄像机是一种把光学图像符号转变为电信号,以便存储或者传输的电子设备。对于那些刚刚接触摄影的新手用户而言,掌握摄像机的基本使用技巧,显得非常重要。那么摄像机的使用方法是怎样的呢?下面是小编整理的相关内容,欢迎阅读参考!摄像机的使用:拿稳机器摄像机最好是用两...
相关文章
- 关于暑假计划英语作文:Plan for the Coming Summer Holiday
- 冀教版英语《Tomorrow We Will Work and Play》教学设计范文
- Could you tell me how to get to the National Stadium ?评课稿大纲
- 教材三年级起点第三册Module8 Sports Day Unit1 What are you going to do
- MacBook Pro with Retina display 不适合做网页设计吗?
- 七年级英语下册What time do you go to school?评课稿
- i recall with embarrassing clarity the flavor of those particular ashes ?
- 葡萄牙语的历史:Revolucionários apossam-se de Porto Alegre
- 解析cpu power limit control 主机BOIS里的配置经验
- 以HappyPrimarySchoolLife为题的英语作文