Help us understand the problem. What is going on with this article?

python3系でのPython Image Libraryの使用方法

More than 3 years have passed since last update.

O'Reillyの「ゼロから作るDeep Learning」の3章。
MNIST画像(手書き数字認識のサンプル画像)を表示するのにPILを使うよって。

PIL(Python Image Library)についてはこちらなどご参照ください
http://www.lifewithpython.com/2013/09/pil.html

サンプルコードを写経して実行。したらエラーがでましたね。

from PIL import Image
...
Traceback (most recent call last):
  File "/Users/ukwksk/Training/orreilly-deep-learning/chapter03/section3_6_number_recognition.py", line 7, in <module>
    from PIL import Image
ImportError: No module named 'PIL'

「PILがありませんよ」
あ、標準ライブラリじゃないのね。

$ pip install PIL
Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

PILってライブラリはないの...?

調べたところ、PILは2系までのイブラリで、3系にはないっぽい
https://librabuch.jp/blog/2013/05/python_pillow_pil/

「本書では下記のプログラミング言語とライブラリを使用します。
- Python3系
- NumPy
- Matplotlib 」
とはなんだったのか..

というわけで上記のURLに従って
$ pip install pillow
で、無事に解決しました。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした