在ubuntu 14.04上安装Pillow失败

时间:2017-06-14 08:34:49

标签: django pip pillow

我尝试在我的ubuntu 14.04上安装枕头,我收到以下错误消息。 我应该用easy_install安装吗?因为我听说这个点不起作用。请问有什么建议? 或者我需要在运行命令之前安装

  

pip安装枕

  running egg_info

writing dependency_links to Pillow.egg-info/dependency_links.txt

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

warning: manifest_maker: standard file '-c' not found



reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching '.travis'

warning: no previously-included files found matching '.travis/*'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext





The headers or library files could not be found for zlib,

a required dependency when compiling Pillow from source.



Please see the install instructions at:

   https://pillow.readthedocs.io/en/latest/installation.html



Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/media/mohit/mohit1/1.8/matchmaker/build/pillow/setup.py", line 756, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:



The headers or library files could not be found for zlib,

a required dependency when compiling Pillow from source.



Please see the install instructions at:

   https://pillow.readthedocs.io/en/latest/installation.html

3 个答案:

答案 0 :(得分:0)

我安装了所有软件包,然后收到了错误

  

错误:命令&#39; x86_64-linux-gnu-gcc&#39;退出状态1失败

然后我尝试了命令

sudo apt-get install gcc python-dev

然后我得到了结果

  

成功安装枕头油文件

什么是olefile?是否适用于django?

答案 1 :(得分:0)

试试这个,

sudo apt-get install libjpeg-dev

答案 2 :(得分:0)

根据Wikipedia Pillow在Ubuntu 13.04及更高版本中打包为 python-pil python3-pil

要在Ubuntu 14.04及更高版本中安装Python Imaging Library,请打开终端并输入:

sudo apt install python-pil # for python 2.X

和/或...

sudo apt install python3-pil # for python 3.X 

如果imageTk导入不起作用,请运行此命令:

sudo apt install python3-pil.imagetk # for Python 2.X replace `python3-` with `python-`