简体   繁体   English

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

[英]Trouble Installing Pillow Raspbian Python 3.5 (Missing JPEG Dependency)

As you read in the title, I'm having trouble installing Pillow for Python 3 on Raspbian Jessie (raspberry pi 3).正如您在标题中看到的,我在 Raspbian Jessie(树莓派 3)上安装 Pillow for Python 3 时遇到了问题。 The error says:错误说:

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

plus a whole 300 some lines of other stuff, if the pastebin helps, http://pastebin.com/b3UUskB4加上整整 300 行其他东西,如果 pastebin 有帮助, http://pastebin.com/b3UUskB4

I've tried making sure all required dependencies, http://pillow.readthedocs.io/en/3.0.x/installation.html#old-versions , were installed as follows:我试过确保所有必需的依赖项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>

And specifically for libjpeg and openjpeg (the 2 that I'd assume are the problem), I did:特别是对于 libjpeg 和 openjpeg(我认为是问题的两个),我做了:

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

I've also searched this issue before coming here.来这里之前我也搜索过这个问题。 One thread I found, https://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil , which is for pil rather than pillow, said that pillow is probably looking in the wrong place for those dependencies, in which case I should execute the following:我发现的一个线程https://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil用于 pil 而不是枕头,它说枕头可能看错了这些依赖项的位置,在这种情况下,我应该执行以下操作:

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/

but since those exact commands aren't going to work for my specific case, I tried to fix them and instead did:但是由于这些确切的命令不适用于我的特定情况,因此我尝试修复它们,而是执行了以下操作:

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

So really I'm not sure what I'm doing wrong here, but any guidance would be greatly appreciated, thanks in advance for any help!所以我真的不确定我在这里做错了什么,但任何指导将不胜感激,在此先感谢您的帮助!

I'm going to suggest here that since Jessie is Debian and Ubuntu is a flavor of Debian that we can take a look at some Ubuntu posts for help.我将在这里建议,由于 Jessie 是 Debian 而 Ubuntu 是 Debian 的一种风格,我们可以查看一些 Ubuntu 帖子以寻求帮助。 I have some experience with Python and Debian on microcomputers and indeed I found the apt-get business to go much the same as with Ubuntu on the desktop.我在微型计算机上使用 Python 和 Debian 有一些经验,实际上我发现apt-get业务与桌面上的 Ubuntu 非常相似。

To wit, this post may provide the solution--- try build-dep rather than install .也就是说, 这篇文章可能会提供解决方案——尝试build-dep而不是install In particular, see the answer by roadmr on Jul 26 '13 and the links that he provides.特别是,请参阅 roadmr 于 2013 年 7 月 26 日的回答以及他提供的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM