Fail During Installation of Pillow (Python Module) in Linux

Fail during installation of Pillow (Python module) in Linux

Thank you @mfitzp. In my case (CentOS) these libs are not available in the yum repo, but actually the solution was even easier. What I did:

sudo yum install python-devel
sudo yum install zlib-devel
sudo yum install libjpeg-turbo-devel

And now pillow's installation finishes successfully.

Pip can't install pillow

try with this :

python3 -m pip install Pillow

if it won't work check this out :

apt-get install python-dev
apt-get install libjpeg-dev
apt-get install libjpeg8-dev
apt-get install libpng3
apt-get install libfreetype6-dev
ln -s /usr/lib/i386-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib

pip install PIL --allow-unverified PIL --allow-all-external

Be careful, on 64 bit platforms, the linked path needs to be different,

/usr/lib/x86_64-linux-gnu/libfreetype.so .

For a more architecture independent solution, create the links like

ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/

Also for Raspbian Stretch(Raspberry Pi) you can write:

sudo apt install python3-dev libjpeg8-dev libpng-dev libfreetype6-dev

How to fix pip installation error on pillow

Pillow 6.2.0 now supports Python 3.8 and has prebuilt wheels available.

Make sure you're using Python 3.8.0 final or later with pip 19.2 or later.

To upgrade:

python -m pip install --upgrade pip
python -m pip install --upgrade pillow

Reason for preferring python -m pip install over pip install:

  • https://snarky.ca/why-you-should-use-python-m-pip/

Error for pip install Pillow on Ubuntu virtualenv

Finally I have found the answer to this headache!

It turns out I have two flag settings in my .bashrc:

export CFLAGS=-Qunused-arguments                                    
export CPPFLAGS=-Qunused-arguments

The .bashrc was copied from my Macbook Pro and these two flags were required as a work around for XCODE. It seems that they will break in Linux.

After removing these two flags, pip install Pillow works as expected.

Thanks everyone for the help.

Why do I get an error when installing Pillow 3.0.0 on Ubuntu?

Did you install the dependencies for pillow ? You can install them by

$ sudo apt-get build-dep python-imaging
$ sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev

easyocr installation error when install pillow

I think that i ommit the line of error, but seeing on others foruns the error was caused because i was using the version 3.10 of python when the library Pillow, that was causing the installation error, is only supported for 3.9.12 of olders versions, so to resolve the problem we have to uninstall the actual python version and install the correct python version or create a virtual enviroment with the correct python version (the venv is a hint mine).

Thanks for everyones help and i hope that help others people with similary problem.



Related Topics



Leave a reply



Submit