python2.7下安装PIL库
2015-07-27 10:59
531 查看
window7下安装
1、因为PIL需要C++支持,先安装MicrosoftVisualC++9.0,安装下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=44266
2、pipinstall
PIL--allow-externalPIL--allow-unverifiedPIL
或者直接下载exe版本:http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.7.exe
http://www.pythonware.com/products/pil/
ubuntu下安装
1、先安装gcc编译
sudoapt-getinstallpython-dev
2、安装依赖包
sudoapt-getinstalllibjpeg8-devzlib1g-devlibfreetype6-dev
3、创建链接,因为PIP安装软件包时,并没有安装在系统路径里,因此做一个软连接。
对于64位系统:
对于32位系统:
4、安装,允许外部源
因為PIL引用了外部的源.所以sudopipinstallpil安装失败
如果报错
_imagingft.c:73:31:fatalerror:freetype/fterrors.h:Nosuchfileordirectory
重新执行pipinstall
note:因为PIL库已经不维护了,建议安装pillow,只要pipinstallpillow即可
1、因为PIL需要C++支持,先安装MicrosoftVisualC++9.0,安装下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=44266
2、pipinstall
PIL--allow-externalPIL--allow-unverifiedPIL
或者直接下载exe版本:http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.7.exe
ubuntu下安装
1、先安装gcc编译
sudoapt-getinstallpython-dev
2、安装依赖包
sudoapt-getinstalllibjpeg8-devzlib1g-devlibfreetype6-dev
3、创建链接,因为PIP安装软件包时,并没有安装在系统路径里,因此做一个软连接。
对于64位系统:
因為PIL引用了外部的源.所以sudopipinstallpil安装失败
sudopipinstallPIL--allow-externalPIL--allow-unverifiedPIL
如果报错
_imagingft.c:73:31:fatalerror:freetype/fterrors.h:Nosuchfileordirectory
cd/usr/include
sudoln-sfreetype2freetype
重新执行pipinstall
note:因为PIL库已经不维护了,建议安装pillow,只要pipinstallpillow即可
相关文章推荐
- 转载:python super()及相关引申
- Python中map()函数
- 命令行2048
- Windows下Python包和模块的安装方法
- 正则
- Sublime2下配置Python模块查找路径PYTHONPATH
- Python—global vs local variables
- Python中特殊函数集锦
- python用于测试的failIf,failUnless
- Python logging模块详解
- Python - 命令行参数
- 【python】hust virtual judge 交题记录抓取
- 获取分享社最新一期的迅雷分享账号
- 用Python模拟浏览器登录
- python 爬图 helloworld
- Python中特殊函数集锦
- 在Python中的Django框架中进行字符串翻译
- 在Python的Django框架中创建语言文件
- Python多线程结合队列下载百度音乐的方法
- Python实现删除当前目录下除当前脚本以外的文件和文件夹实例