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
-
Genymotion安装教程步骤详解
下载好的Genymotion的版本为:genymotion-2.2.0-vbox如下图所示:双击安装软件包,会提示安装向导点击【Next】下一步的意思。再选择一个安装的路径,我使用的是默认的.点击【Next】此时会提示是不是要开始菜单中显示Genymotion快捷方式的名称为什么样的。或是不显示名...
-
电脑重装系统win7教程
所谓“重装”,是指重新安装操作系统,下面是小编帮大家整理的电脑重装系统win7教程,希望大家喜欢。重装系统Win7前首先,重装系统之前需要将电脑中的重要资料备份或转移,根据自己情况,把一些较重要的文件移动到别的盘(只要不是C盘就行)。然后就开始重装系统啦开始重装系...
-
重新安装Windows的教程
1、执行病毒和恶意软件扫描您的计算机上,然后重新安装Windows。虽然重新安装过程将覆盖任何受感染的系统文件,可以感染其他计算机上的文件。运行扫描,再重新安装,以消除感染或删除受感染的文件,使他们无法再次感染你的系统重新安装后,你已经完成了。当扫描完成后,关闭...
-
便秘吃什么水果好
只要说到便秘,凡是有一点常识的都先想到吃香蕉,由于香蕉中含有大量的水溶性纤维,因此它具有很好的通便作用,这一点经研究已经得到了证实。有研究表明,水溶性纤维不仅可以调节肠胃道的菌丛生态,还可以帮助益菌生长与抑制害菌生长,从而起到调节肠胃的作用。一、便秘吃什...
相关文章
- i recall with embarrassing clarity the flavor of those particular ashes ?
- Could you tell me how to get to the National Stadium ?评课稿大纲
- MacBook Pro with Retina display 不适合做网页设计吗?
- 冀教版英语《Tomorrow We Will Work and Play》教学设计范文
- 教材三年级起点第三册Module8 Sports Day Unit1 What are you going to do
- 七年级英语下册What time do you go to school?评课稿
- 关于暑假计划英语作文:Plan for the Coming Summer Holiday
- 解析cpu power limit control 主机BOIS里的配置经验
- 葡萄牙语的历史:Revolucionários apossam-se de Porto Alegre
- 以HappyPrimarySchoolLife为题的英语作文