Can't install PIL after Mac OS X 10.9 - python

I've just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one.
So I try to execute sudo pip install pil, but I get this error:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
My Xcode is up-to-date and I don't have any idea. Is it possible that PIL is not yet 10.9 compatible ?

Following worked for me:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
sudo pip install pil
UPDATE:
But there is more correct solution below, provided by Will.
open your terminal and execute:
xcode-select --install

open your terminal and execute:
xcode-select --install

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/ /usr/local/include/X11
helps for me!
os x 10.9
pip install pillow
but! after pip install ...
*** ZLIB (PNG/ZIP) support not available
and finally i fix it by running:
xcode-select --install
then reinstall pillow
pip install pillow
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 2.2.1
platform darwin 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- TIFF G3/G4 (experimental) support available
--- FREETYPE2 support available
--- LITTLECMS support available
--- WEBP support available
--- WEBPMUX support available
--------------------------------------------------------------------

Works for me ( OS X Yosemite 10.10.2 - Python 2.7.9 ) :
xcode-select --install
sudo pip install pillow
Try this to check it:
from PIL import Image
image = Image.open("file.jpg")
image.show()

Here is what I did, some steps may not be necessary just for PIL but I needed libpng and others anyways:
1) Run xcode install, use this command or download updates from the app store:
xcode-select --install
1b) Add the Command Line Tools optional tool, in Mountain Lion this was an option on the xcode Download page, but now you have to register with your apple id and download from: https://developer.apple.com/downloads/
Look for Command Line Tools (OS X Mavericks) for Xcode
2) Install everything needed for python (using brew), I believe you can use port as well:
brew install readline sqlite gdbm
brew install python --universal --framework
brew install libpng jpeg freetype
Unlink/ relink if needed i.e. if upgrading.
3) Install Pip and required modules:
easy_install pip
sudo pip install setuptools --no-use-wheel --upgrade
4) Finally this works with no errors:
sudo pip install Pillow
UPDATE 11/04/14: PIL repo no longer receives updates or support so Pillow should be used. The below is now deprecated so stick with Pillow.
sudo pip install pil --allow-external pil --allow-unverified pil
UPDATE (OLD) : The same thing applies when installing Pillow (PIL fork) and should be mentioned as its quickly becoming a replacement in most cases of PIL. Instead of installing pip in step 4, run this instead:
sudo pip install Pillow
Hope this helps someone!

installing command line tools fixed the issue for me
you have to install them separately as they are not part of the packages in xcode now:
https://developer.apple.com/downloads/index.action?=command%20line%20tools#

Non of those worked for me.. I kept receiving:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
So I found a work around with the following solution:
sudo export CFLAGS=-Qunused-arguments
sudo export CPPFLAGS=-Qunused-arguments
sudo pip install PIL --allow-external PIL --allow-unverified PIL
This way I was able to install.

I had a similar problem: Installing pillow failed with clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future], installing command line tools failed with Can't install the software because it is not currently available from the Software Update server., and even after installing the command line tools manually, the compilation of PIL failed.
This happens cause clang under the newest version of xcode doesn't warn on unknown compiler flags, but rather stop the compilation with a hard error.
To fix this, just run export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" on the terminal before trying to compile (installing pil).

Simply run
pip install pil --allow-external pil --allow-unverified pil

This my steps on mac os 10.9.1
1. sudo su
2. easy_install pip
3. xcode-select --install
4. pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL

You could use Homebrew to do the install http://brew.sh
brew tap Homebrew/python
brew install pillow

Make sure you have Command Line Tools installed on your xcode. Then execute:
sudo pip install pil --allow-external pil --allow-unverified pil

I was having the following error
building 'PIL._imagingft' extension
_imagingft.c:62:10: fatal error: 'freetype/fterrors.h' file not found
#include <freetype/fterrors.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
The solution to this was to symlink freetype2 to freetype and this solved the problem.

I didn't want to install XCode (I don't use it) and I'm loath to fiddle with Application directory. I've cribbed from the many answers in this post and the following two steps work for me with 10.9.5:
sudo easy_install pip
sudo pip install pillow
It did appear to me strange that I had to use easy_install to install pip. But pip didn't want to work for me before that (re-)install.

Found the solution ... You've to symlink X11 like this ln -s /opt/X11/include/X11 /usr/local/include/X11 and then sudo pip install pil should work.

Reusing #DmitryDemidenko's answer that is how it worked for me:
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
and then
sudo pip install -U PIL --allow-external PIL --allow-unverified PIL

Execute the bellow command lines. Works like a charm on Mac OS 10.9.5
easy_install pip
sudo pip install setuptools --no-use-wheel --upgrade
sudo pip install Pillow
Best,
Theo

That's what I did:
First upgrade to Xcode 5 (I am running 10.9). Then, execute the following commands in a terminal:
$ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 usr/include/

A more complete solution requires the installation of the Xquartz X11 subsystem that has been built outside of Apple for several years now. Here are the steps I used to get it all working
Install XQuartz from http://xquartz.macosforge.org/landing/
Run sudo pip install pillow

As the accepted answer is the right one with xcode-select --install but some people (including me) may encounter Can't install the software because it is not currently available from the Software Update server
If you are using beta software (as I am using Yosemite now and had the same problem) you NEED to get the CLT separately since it is NOT included in XCode (even xcode beta)
Head over to developers.apple.com and get CLT tools for your OS ;)
P.S. You don't need XQuartz for PIL or Pillow to work

My machine which was recently upgraded from OS 10.8 -> 10.9 got stuck in a loop between xcrun and lipo.
Rename /usr/bin/lipo to /usr/bin/lipo_broken
Refer to this thread for further information on how to resolve:
xcrun/lipo freezes with OS X Mavericks and XCode 4.x

Install Pillow instead:
sudo pip install pillow

ln -s /usr/local/include/freetype2 /usr/local/include/freetype
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pil

Try this:
ln -s /usr/local/include/freetype2 /usr/local/include/freetype

sudo pip uninstall pillow
pip install pillow
worked for me. I'm running Python 2.7.9 on Yosemite.import PIL now works for me.

Installing PIL (Imaging.1.1.7) on Mac OSC 10.10 Yosemite. I tried numerous fixes recommended here but ran into trouble with each one. I finally solved this problem by editing the setup.py file such that:
TCL_ROOT = "/opt/X11/include"
which passes the appropriate include path for X11 in the compilation of _imagingtk.c, which was causing the problem for me. Worked immediately after change.

I've moved from pyenv to virtualenv and this fixed my problem.

ln -s /opt/X11/include/X11 /usr/local/include/X11
pip install pil without sudo

Related

Import pyaudio doesn't work - Symbol not found: _PaMacCore_SetupChannelMap on mac (Big Sur M1 Apple Silicon)

I am trying to install pyaudio on my new Macbook Air with the M1 chip (Big Sur). At first I couldn't get past the famous src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found error. I remember I had this issue on my other laptop as well, but then a simple brew install portaudio fixed it. Well, not this time.
After trying a lot of different things, finally I found this guide and after finding my homebrew directory, I could do:
export LIBRARY_PATH=/opt/homebrew/lib/:$LIBRARY_PATH - same with C_INCLUDE
After I did this, pyaudio installed fine! However, now I'm getting an error when I try to import pyaudio to any python program and run it:
Traceback (most recent call last):
File "/Users/bende/GitHub/fretboard-learner/main.py", line 5, in <module>
import pyaudio
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so, 2): Symbol not found: _PaMacCore_SetupChannelMap
Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_portaudio.cpython-39-darwin.so
I tried googling it but to no avail, I'm really not sure what is happening. All I can think of is that it has to do something with the M1 chip, because the install worked just fine on a non-M1 mac.
Does anyone have any idea what could be causing this?
Don't know if you still need the solution, but here was mine after hours of googling (I also owned a Mac m1):
I could not install PyAudio at first and encountered problems even after I successfully installed PyAudio. I used python 3.9 installed with brew for the process.
uninstall previous version of portaudio + PyAudio
(optional) Install the latest Brew supported for Mac m1 using the command on the Brew homepage
(optional) Install wheel and setuptools: python3 -m pip install --upgrade pip setuptools wheel
Install the latest version of portaudio (I believe this is the core problem, stable version 19.6.0 did not work): brew install portaudio --HEAD
Install PyAudio with pip: python3 -m pip install pyaudio --global-option="build_ext" --global-option="-I/opt/homebrew/include" --global-option="-L/opt/homebrew/lib"
Restart terminal might help if things did not go well.
For Intel-based homebrew installation
For those who must use python packages which are not yet available for the arm-architecture, we must revert to intel-based Python packages. This is not trivial and took me almost a day, so I describe it to some time for people in need.
Here's what you need to do:
Run a terminal under Rosetta
Get Info | Run under Rosetta
Install homebrew as intel-based version
In terminal created in (1), run:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Create alias for intel-based homebrew
In .bash_profile, insert:
alias ibrew="arch -x86_64 /usr/local/bin/brew"
Install boost and boost_python libraries:
With brew from step (3), run:
ibrew install --build-from-source -vd boost
ibrew install --build-from-source -vd boost-python3
Install portaudio
With brew from step (3), run:
ibrew install portaudio
ibrew link portaudio
KEY: This installs portaudio into /usr/local/Cellar/portaudio/19.7.0, and must be referenced for the pyaudio installation!!!
Install pyaudio
We now can install pyaudio with the portaudio version we installed by intel-based homebrew. The version number after /portaudio/ may differ, please adjust to yours.
python -m pip install --global-option='build_ext' --global-option='-I/usr/local/Cellar/portaudio/19.7.0/include' --global-option='-L/usr/local/Cellar/portaudio/19.7.0/lib' --force pyaudio
While troubleshooting the same (including following the steps from momoclouq's answer on this question) I ran into this error as well. My final solution was:
My homebrew was only installed in /usr/local which is for rosetta-emulated (Intel) code. See more information in this Stackoverflow question/answer.
Once I had the correct homebrew installation for ARM64 under /opt/homebrew I removed my previous portaudio installation and did the following:
$arch -arm64 /opt/homebrew/bin/brew install portaudio
$pip3 install --no-cache-dir --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio Make sure this path aligns with your arch arm64 portaudio installation.
The first answer was helpful, but global-option doesn't work anymore, so here's an updated sequence of commands:
(I ran this on a Mac M1)
# uninstall previous version of portaudio + PyAudio
pip uninstall pyaudio
brew uninstall portaudio
# make sure default stuff set up
python3 -m pip install --upgrade pip setuptools wheel
# reinstall portaudio and pyaudio
brew install portaudio --HEAD
export CFLAGS="-I/opt/homebrew/include"
export LDFLAGS="-L/opt/homebrew/lib”
python3 -m pip install pyaudio
https://stackoverflow.com/a/73930804/4656769

Pillow installation PyPy3 missing zlib

I'm curretnly trying to use PIL with PyPy3, but no matter how I try to install it I get an error. First I tried to install it normally using pypy3 pip install pillow, but got the error that I need zlib. So after searching for a solution for a while I found the easy_install pillow command which fixed this problem for most people, but for me it leads to the same error. I hope somebody can help me out.
Error:
File "C:\Users\name\AppData\Local\Temp\easy_install-uqrsyszz\Pillow-4.0.0\setup.py", line 791, in <module> setuptools.sandbox.UnpickleableException: RequiredDependencyException('\n\nThe headers or library files could not be found for zlib,\na required dependency when compiling Pillow from source.\n\nPlease see the install instructions at:\n http://pillow.readthedocs.io/en/latest/installation.html\n\n')
got it fixed by using pypy3 install pillow --global-option="build_ext" --global-option="--disable-zlib" --global-option="--disable-jpeg". :)
I was having a similar issue.
After some research, I found this solution which got me most of the way there. I had to perform step #4 below in addition to get it to work for me:
Install homebrew (if you don't already have it):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Brew install zlib:
brew install zlib
Set the following variables:
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
Brew install jpeg
brew install jpeg
Finally, pip install Pillow:
pip3 install Pillow==7.1.2
For linux debian based systems, the below solves the issue.
sudo apt install libjpeg-dev zlib1g zlib1g-dev

Having trouble installing PyAudio for Python3 on Mint

I was following the instructions here and I'm having trouble getting the installation to work. Basically, the first part works fine. I downloaded portaudio, followed the instructions, and it all seemed to work.
However, when I triedpython3 setup.py install, I got an error. The error came from the /src/_portaudiomodule.c file, and it said that "The file Python.h could not be found". I don't really understand what's going on because there was no Python.h file when I extracted the PyAudio archive. I don't know where the Python.h file was supposed to come from.
I'm kind of a noob to unix systems so I could have easily made a mistake somewhere. I've been trying to solve this for hours and I've had no luck so far. Thanks in advance for your help!
To install the latest version of pyaudio using conda:
source activate -your environment name-
pip install pyaudio
You may run into the following error when installing from pip:
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
compilation terminated.
error: command 'gcc' failed with exit status 1
That is because you don't have the PortAudio development package installed. Install it with:
sudo apt-get install portaudio19-dev
You don't need to compile pyaudio. To install PyAudio, run:
$ sudo add-apt-repository universe
$ sudo apt-get install python-pyaudio python3-pyaudio
The first command enables Universe Ubuntu repository.
If you want to compile it e.g., to use the latest version from git; install build dependencies:
$ sudo apt-get build-dep python-pyaudio python3-pyaudio
After that, you could install it from sources using pip:
$ python3 -mpip install pyaudio
Or to install the current version from git:
$ pip install -e git+http://people.csail.mit.edu/hubert/git/pyaudio.git#egg=pyaudio
Run pip commands inside a virtualenv or add --user command-line option, to avoid modifying the global python3 installation (leave it to the package manager).
I've tested it on Ubuntu. Let me know if it fails on Mint.
I have found the work arround for mac.
please refer the below steps to install pyaudio on python 3.5
Follow these steps :
export HOMEBREW_NO_ENV_FILTERING=1
xcode-select --install
brew update
brew upgrade
brew install portaudio
pip install pyaudio
I was able to get it install with anaconda, using this package.
Follow install instructions for linux here, then do:
conda install -c bokeh pyaudio=0.2.7
try to install using the the below command
pip install pyaudio
after that install the required Microsoft Visual C++ 14.0
refer the below image for the same.
and restart the system and run the same command again
pip install pyaudio
Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. To install this package, enter:
sudo apt-get install python3-dev

Why can't Python import Image from PIL?

The single line that I am trying to run is the following:
from PIL import Image
However simple this may seem, it gives an error:
Traceback (most recent call last):
File "C:\...\2014-10-22_12-49.py", line 1, in <module>
from PIL import Image
File "C:\pyzo2014a\lib\site-packages\PIL\Image.py", line 29, in <module>
from PIL import VERSION, PILLOW_VERSION, _plugins
ImportError: cannot import name 'VERSION'
In case that's helpful, I installed pillow from https://pypi.python.org/pypi/Pillow/2.6.1 (file Pillow-2.6.1.win-amd64-py3.4.exe) before running this (before that there was already som PIL install, which I uninstalled). The script is run in Pyzo with Python version 3.4.1.
What is going wrong, how can I import Image?
I had the same error. Here was my workflow. I first installed PIL (not Pillow) using
pip install --no-index -f https://dist.plone.org/thirdparty/ -U PIL
Then I found Pillow and installed it using
pip install Pillow
What fixed my issues was uninstalling both and reinstalling Pillow
pip uninstall PIL
pip uninstall Pillow
pip install Pillow
I had the same issue, and did this to fix it:
In command prompt
pip install Pillow ##
Ensure that you use
from PIL import Image
I in Image has to be capital. That was the issue in my case.
FWIW, the following worked for me when I had this same error:
pip install --upgrade --force-reinstall pillow
For me, I had typed image with a lower case "i" instead of Image. So I did:
from PIL import Image NOT from PIL import image
If you use Anaconda, you may try:
conda install Pillow
Example
All the answers were great however what did it for me was a combination of uninstalling Pillow
pip uninstall Pillow
Then installing whatever packages you need e.g.
sudo apt-get -y install python-imaging
sudo apt-get -y install zlib1g-dev
sudo apt-get -y install libjpeg-dev
And then using easy_install to reinstall Pillow
easy_install Pillow
Hope this helps others
Install Pillow from Command Line:
python -m pip install pillow
The current free version is PIL 1.1.7. This release supports Python 1.5.2 and newer, including 2.5 and 2.6. A version for 3.X will be released later.
Python Imaging Library (PIL)
Your python version is 3.4.1, PIL do not support!
In Ubuntu OS, I solved it with the followings commands
pip install Pillow
apt-get install python-imaging
And sorry, dont ask me why, it's up to me ;-)
had the same error while using pytorch code which had deprecated pillow code. since PILLOW_VERSION was deprecated, i worked around it by:
Simply duplicating the _version file and renaming it as PILLOW_VERSION.py in the same folder.
worked for me
I had the same problem, pillow was installed with an environment.yml in anaconda
I am quickly learning that pip and setuptools must always be up to date or I will have problems. Always update these tools before installing packages.For any package import problem uninstall the package upgrade the listed tools(maybe even your base environment) and reinstall.
conda uninstall pillow
python -m pip install pip --upgrade
pip install setuptools --upgrade
pip install pillow
If using Anaconda, from the base environment first run the following before installing packages/environments:
conda update conda
Updating the base env is not required to fix this issue but is a good practice to avoid similar problems
#theeastcoastwest touched on the pip upgrade in their answer but I felt more information was needed
If you've got different Python versions, be sure to install it with the version, you start the script:
python3.9 -m pip install pillow --upgrade
After a lot of googling and different solutions, this is the most efficient, I found.
I am also facing same error, just try to uninstall and resinstall
#uninstall and resinstalltion cmds
pip uninstall pillow
pip uninstall PIL
pip install pillow
Pillow installation link basics link
Using jupyter note book do this below follwing installationa and verified the code as shown below
pip install pillow
#(or)
pip install PIL
import PIL
print(PIL.__version__)
'8.4.0'
(Or) You are using command prompt installation then follow below instruction for windows. Personally suggest this below method.
Microsoft Windows [Version 10.0.19043.1348]
(c) Microsoft Corporation. All rights reserved.
>pip install pillow
Requirement already satisfied: pillow in c:\users\admin\appdata\roaming\python\python310\site-packages (9.0.0)
>python
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>> (PIL.__version__)
'9.0.0'
>>> quit()
do from PIL import Image, ImageTk
If you did all and it didn't work again like mien, do this
copy Image.py and ImageTk.py from /usr/lib/python3/dist-packages/PIL on ubuntu and C:/Users/yourComputerName/AppData/Local/Programs/Python/Python36/Lib/PIL on windows to your projects directory and just import them!
Any library/package you import must have its dependencies and subordinate parts in the same python directory. in linux if you
Python3.x -m pip install <your_library_name_without_braces>
what happens is, it installs on the default python. so first make sure that only 1 python 2.x and 1 python 3.x versions are on your pc.
If you want to successfully install matplotlib
you need these lines,
python -m pip install matplotlib pillow numpy pandas
the last 2 were auxiliary libs, and must have.
what that worked for me:
go to the fodler
C:\Users\{YOUR PC USER NAME}\AppData\Local\Programs\Python\Python37-32\Lib\site-packages
and either delete or change the name of the PIL folder and DONE.
had to do it after running
pip uninstall PIL
as other suggested yielded for me
WARNING: Skipping PIL as it is not installed.
But I am not sure about the consequences of removing that library so I will edit this post if I ever get into a problem because of that.
Now, I actually did some debugging with my brother and found that Pillow (PIL) needed to be initialized. I don't know how to initialize it, so you could probably stick with reinstalling Pillow.
Try import PIL instead of from PIL import image.

Error installing Pillow

I'm trying to install Pillow for Python and i run this command on the terminal
sudo pip install Pillow
and i get this error
clang: error: no such file or directory: 'build/temp.macosx-10.10-intel-2.7/_imagingtk.o'
clang: error: no such file or directory: 'build/temp.macosx-10.10-intel-2.7/Tk/tkImaging.o'
error: command 'cc' failed with exit status 1
Any solutions for this? i tried looking in stack overflow only similar errors but not the same one
This might be the same as this bug in Pillow 2.5.0.
It's been fixed, to be released soon in 2.5.1.
To test the dev version:
sudo pip install git+https://github.com/python-pillow/Pillow.git
Or install version 2.4.0:
sudo pip install pillow==2.4.0
Edit: Pillow 2.5.1 has now been released so you can just do:
sudo pip install pillow
First: Install python-dev
apt-get install python-dev
After: install PILLOW
pip install pillow
$ sudo easy_install pip==20.3.4
$ sudo apt-get build-dep pillow
$ sudo pip2 install pillow
Successfully installed pillow-6.2.2
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial.
It was run on 32bit Chromenotebook
Try running this command:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow
(You may find additional possible answers at this similar question: Installing Pillow/PIL on Mavericks)
If you're on macOS, try: brew install libtiff libjpeg webp littlecms

Categories

Resources