Correspondence memo when an error occurs when trying to install pillow on python3.9. The conclusion is that python3.9 was downgraded to python3.8 series and the installation was successful.
$ python3 -V
Python 3.9.0
$ pip3 list
Package Version
---------- -------
pip 19.2.3
setuptools 41.2.0
six 1.15.0
wheel 0.33.1
Install pillow.
$ pip3 install pillow
Collecting pillow
Using cached Pillow-7.2.0.tar.gz (39.1 MB)
Using legacy 'setup.py install' for pillow, since package 'wheel' is not installed.
Installing collected packages: pillow
Running setup.py install for pillow ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bh/qn_1nbf10t93r800p2nf70840000gn/T/pip-install-2tumuz0z/pillow/setup.py'"'"'; __file__='"'"'/private/var/folders/bh/qn_1nbf10t93r800p2nf70840000gn/T/pip-install-2tumuz0z/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bh/qn_1nbf10t93r800p2nf70840000gn/T/pip-record-mj6xe2pw/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pillow
(Omitted)
It seems that pillow does not support python3.9.0. Uninstall python3.9.0.
$ sudo rm -rf /Library/Frameworks/Python.framework
To install python3.8 series, first install pyenv.
$ brew install pyenv
Pass the path to pyenv.
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
Install python 3.8.6.
$ pyenv install 3.8.6
$ pyenv versions
* system (set by /Users/hoge/.pyenv/version)
3.8.6
$ python3 -V
Python 3.8.6
Reinstall pillow.
$sudo pip3 install pillow
$ pip3 list
Package Version
---------- -------
Pillow 7.2.0 ★
pip 19.2.3
setuptools 41.2.0
six 1.15.0
wheel 0.33.1
that's all.
Recommended Posts