无法安装 Pillow Raspbian Python 3.5(缺少 JPEG 依赖项)

Trouble Installing Pillow Raspbian Python 3.5 (Missing JPEG Dependency)

如您在标题中所读,我在 Raspbian Jessie (raspberry pi 3) 上安装 Python 3 的 Pillow 时遇到问题。错误说:

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-versions 都按如下方式安装:

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 非常相似。

也就是说,this post 可能会提供解决方案 --- 尝试 build-dep 而不是 install。特别是,请参阅 roadmr 在 2013 年 7 月 26 日的回答以及他提供的链接。