安装Pillow Raspbian Python 3.5时出现问题(缺少JPEG依赖项)



正如您在标题中所读到的,我在Raspbian Jessie(树莓派3)上安装Pillow for Python 3时遇到了问题。错误显示:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

再加上300多行其他东西,如果pastebin有帮助的话,http://pastebin.com/b3UUskB4

我试着确保所有必需的依赖关系,http://pillow.readthedocs.io/en/3.0.x/installation.html#old-版本,安装如下:

apt-cache search <dependency name>
sudo apt-get install <name found from previous command>

特别是对于libjpeg和openjpeg(我认为这两个是问题所在),我做了:

sudo apt-get install libjpeg8
sudo apt-get install libopenjpeg5

我来这里之前也搜索过这个问题。我发现了一条线索,https://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil,表示pil而不是pillow,表示pillow可能在错误的位置查找这些依赖项,在这种情况下,我应该执行以下操作:

sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so.62 /usr/lib/

但由于这些确切的命令对我的特定情况不起作用,我尝试来修复它们,结果:

sudo ln -s /usr/lib/arm-linux-gnueabihf/libjpeg.so.62 /usr/lib

所以我真的不确定我在这里做错了什么,但任何指导都将不胜感激,提前感谢您的帮助!

我在这里建议,由于Jessie是Debian,而Ubuntu是Debian的一种风格,我们可以看看Ubuntu的一些帖子来寻求帮助。我在微型计算机上使用Python和Debian有一些经验,事实上,我发现apt-get的业务与桌面上的Ubuntu非常相似。

也就是说,这篇文章可以提供解决方案——尝试build-dep而不是install。特别是,请参阅Roadmer在2013年7月26日给出的答案以及他提供的链接。

最新更新