[已解決]linux安裝pillow報錯: ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting


linux安裝pillow報錯:

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

經搜索,找到如下兩種方案:

一:

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

二:

sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

我用的第一種,下面那種可能不支持我用的linux版本,僅留作備用。執行后,再次運行pip install pillow就可以了。

 

官網解決方案: https://pillow.readthedocs.io/en/3.0.0/installation.html#linux-installation

Linux Installation

Note

Most major Linux distributions, including Fedora, Debian/Ubuntu and ArchLinux include Pillow in packages that previously contained PIL e.g. python-imaging. Please consider using native operating system packages first to avoid installation problems and/or missing library support later.

We do not provide binaries for Linux. If you didn’t build Python from source, make sure you have Python’s development libraries installed. In Debian or Ubuntu:

$ sudo apt-get install python-dev python-setuptools

Or for Python 3:

$ sudo apt-get install python3-dev python3-setuptools

In Fedora, the command is:

$ sudo yum install python-devel

Prerequisites are installed on Ubuntu 12.04 LTS or Raspian Wheezy 7.0 with:

$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk

Prerequisites are installed on Ubuntu 14.04 LTS with:

$ sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

Prerequisites are installed on Fedora 20 with:

$ sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
    lcms2-devel libwebp-devel tcl-devel tk-devel


ValueError:--enable-zlib requested but zlib not found, aborting.

Ubuntu14.04下運行pip install pillow==3.1.1報錯,ValueError: --enable-zlib requested but zlib not found, aborting.

$ sudo apt-get build-dep python-imaging

$ sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev

$ pip install Pillow==3.1.1

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM