As you read in the title, I'm having trouble installing Pillow for Python 3 on Raspbian Jessie (raspberry pi 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
I've tried making sure all required dependencies, http://pillow.readthedocs.io/en/3.0.x/installation.html#old-versions , were installed as follows:
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:
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:
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. 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.
To wit, this post may provide the solution--- try build-dep
rather than install
. In particular, see the answer by roadmr on Jul 26 '13 and the links that he provides.