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中用Ctrl+C终止多线程程序的问题解决

复制代码 代码如下:#!/bin/env python # -*- coding: utf-8 -*- #filename: peartest.py imp...

python框架django项目部署相关知识详解

python框架django项目部署相关知识详解

这篇文章主要介绍了python框架django项目部署相关知识详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 一:项目部署的框架...

Python全局变量用法实例分析

本文实例讲述了Python全局变量用法。分享给大家供大家参考,具体如下: 全局变量不符合参数传递的精神,所以,平时我很少使用,除非定义常量。今天有同事问一个关于全局变量的问题,才发现其中...

pytorch forward两个参数实例

以channel Attention Block为例子 class CAB(nn.Module): def __init__(self, in_channels, out_c...

用python 批量更改图像尺寸到统一大小的方法

如下所示: #提取目录下所有图片,更改尺寸后保存到另一目录 from PIL import Image import os.path import glob def convertj...