zoukankan      html  css  js  c++  java
  • [已解决]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

  • 相关阅读:
    461. Hamming Distance
    342. Power of Four
    326. Power of Three
    368. Largest Divisible Subset java solutions
    95. Unique Binary Search Trees II java solutions
    303. Range Sum Query
    160. Intersection of Two Linked Lists java solutions
    88. Merge Sorted Array java solutions
    67. Add Binary java solutions
    14. Longest Common Prefix java solutions
  • 原文地址:https://www.cnblogs.com/xueranzp/p/5128140.html
Copyright © 2011-2022 走看看