CentOS安装pillow报错的解决方法

yipeiwu_com6年前Python基础

安装pillow出现以下问题:

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

----------------------------------------
Cleaning up...
Command /usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-SviNMc-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pillow
Storing debug log for failure in /root/.pip/pip.log

StackOverflow:
http://stackoverflow.com/questions/34631806/fail-during-installation-of-pillow-python-module-in-linux

解决:

sudo yum install python-devel
sudo yum install zlib-devel
sudo yum install libjpeg-turbo-devel

相关文章

Python中的多重装饰器

多重装饰器,即多个装饰器修饰同一个对象【实际上并非完全如此,且看下文详解】 1.装饰器无参数: 复制代码 代码如下: >>> def first(func): &nbs...

Django中的“惰性翻译”方法的相关使用

使用 django.utils.translation.gettext_lazy() 函数,使得其中的值只有在访问时才会被翻译,而不是在 gettext_lazy() 被调用时翻译。 例...

Python 异常处理Ⅳ过程图解

Python 异常处理Ⅳ过程图解

异常的参数 一个异常可以带上参数,可作为输出的异常信息参数。 你可以通过except语句来捕获异常的参数,如下所示: 变量接收的异常值通常包含在异常的语句中。在元组的表单中变量可以接...

Python实现股市信息下载的方法

本文实例讲述了Python实现股市信息下载的方法。分享给大家供大家参考。具体如下: 该程序下载来自yahoo财经的股市信息。 import urllib def getURL(url...

Python 用户登录验证的小例子

复制代码 代码如下:#!/usr/bin/python#coding=gbk class User:    def __init__(self,userna...