Error installing Pillow on ubuntu 14.04

依然范特西╮ 提交于 2019-12-04 08:07:03

问题


I'm trying to install Pillow on Ubuntu 14.04 using this command:

pip install Pillow

but the installation fails with this error:

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

回答1:


The problem was that the package libjpeg-dev was not installed. To solve the problem you should do this:

sudo apt-get install libjpeg-dev



回答2:


Make sure Python-development packages are installed, if not then install it using the following commands :

For Ubuntu

sudo apt-get install python3-dev python3-setuptools

For Fedora

sudo dnf install python-devel

After installing the development packages install the following :

For Ubuntu

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

For Fedora

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



回答3:


You have to install the missing dependencies and libraries that Pillow requires for it to work. Find the dependencies here

This are the current dependancies/libraries for Ubuntu 14.04 for Pilllow 3.0.0+. Install them by running the command below

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



回答4:


There may be a problem where pip is relying on a cached version of the dependencies, and clearing the cache can sometimes solve the problem. Just type

$ rm -rf ~/.cache/pip

Source: github issue




回答5:


You need to follow this tutorial Install pillow doc.

If you had installed, just uninstall and reinstall again:

$ pip uninstall pillow
$ pip install pillow --no-cache-dir


来源:https://stackoverflow.com/questions/32942861/error-installing-pillow-on-ubuntu-14-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!