1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

python3.9にpillowをインストール時の対応

Last updated at Posted at 2020-10-14

python3.9にpillowをインストールしようとしたらエラーになった時の対応メモ。
結論は、python3.9をpython3.8系にダウングレードしてインストール成功。


$ 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 

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

(略)

調べてみるとpillowがpython3.9.0に未対応の様子。
python3.9.0をアンインストール。


$ sudo rm -rf  /Library/Frameworks/Python.framework

python3.8系をインストールするため、まずはpyenvをインストール。


$ brew install pyenv

pyenvにパスを通す。


$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

python3.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

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 

以上。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?