3
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 5 years have passed since last update.

Python3.7でPILがModuleNotFoundErrorになるエラーの解決方法

Posted at

実行環境

$ python

Python 3.7.5 (default, Oct 25 2019, 10:52:18) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin

エラー内容

Python3.7で $ pip install pillow でpillowをインストールしてPILを利用しようとしても、

from PIL import Image の箇所でModuleNotFoundErrorエラーになってしまう。

$ python test.py

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

解決した方法

Anacondaがインストールされている状態で、 $ conda install -c anaconda pillow コマンドでpillowをインストールした。

$ conda install -c anaconda pillow

Collecting package metadata (current_repodata.json): done
Solving environment: done
...
Executing transaction: done

参考になった記事

勉強になりました🙏

https://teratail.com/questions/130649
http://onoz000.hatenablog.com/entry/2018/02/11/142347

3
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
3
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?