在Raspberry Pi上安装Pillow时出错

时间:2015-11-03 19:52:28

标签: python raspberry-pi pillow

我只是想在我的新Raspberry Pi上安装yowsup。一切都很顺利,直到它即将安装枕头。我收到以下错误消息:

Processing dependencies for yowsup2==2.4
Searching for pillow
Reading http://pypi.python.org/simple/pillow/
Best match: Pillow 3.0.0
Downloading https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.zip#md5=dd81f6cc3f3a5e5fe72f0f1d936339c3
Processing Pillow-3.0.0.zip
Running Pillow-3.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-AlZEzs/Pillow-3.0.0/egg-dist-tmp-rX2XN3
Exception in thread Thread-1 (most likely raised during interpreter shutdown):Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):

  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_innerTraceback (most recent call last):

  File "/usr/lib/python2.7/threading.py", line 505, in run  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner

  File "/usr/lib/python2.7/multiprocessing/pool.py", line 353, in _handle_tasks  File "/usr/lib/python2.7/threading.py", line 505, in run
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 329, in _handle_workers
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Exception
TypeError<type 'exceptions.TypeError'>: 'NoneType' object is not callable
: TypeError("'NoneType' object does not support item deletion",) in <Finalize object, dead> ignored
Traceback (most recent call last):
  File "setup.py", line 42, in <module>
    'Topic :: Software Development :: Libraries :: Python Modules'
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 73, in run
    self.do_egg_install()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 101, in do_egg_install
    cmd.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 368, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 588, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 576, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 821, in best_match
    return self.obtain(req, installer) # try and download/install
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 833, in obtain
    return installer(requirement)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 30, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 72, in run
    return func()
  File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 32, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 767, in <module>

  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/bdist_egg.py", line 179, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/bdist_egg.py", line 166, in call_command
    self.run_command(cmdname)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/install_lib.py", line 20, in run
    self.build()
  File "/usr/lib/python2.7/distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "setup.py", line 515, in build_extensions

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

我把它弄了至少一个小时,但无法找到正确的答案。你对我有什么建议吗?

2 个答案:

答案 0 :(得分:13)

因此,如果您未事先安装正确的软件包,就会尝试安装PIL。尝试安装libjpeg。

sudo apt-get install libjpeg-dev

答案 1 :(得分:3)

如果您查看Pillow文档的External Libraries部分,您会发现应该存在多个库,包括libjpegzlib。如果您不想要JPEG支持,则应下载&#34;来源&#34;从PyPI归档,解压缩,然后在生成的目录中运行python setup.py install --disable-jpeg

但是,我不建议这样做,因为您无法使用Pillow处理JPEG。相反,请使用Pi上的包管理器安装您支持的所有库,然后重新运行pip install pillow