Theron
Theron

Reputation: 697

No module named 'Pillow'

I am using Spyder to run a sample code from Kera's doc https://keras.io/examples/mnist_denoising_autoencoder/ Because PIL is deprecated.I changed the line #15

from PIL import image

into

from Pillow import image

Yet I was prompted that 'ModuleNotFoundError: No module named 'Pillow''

I reinstalled everything including re-establishing an environment. By using pip list, Pillow has been installed, versioned 5.4.1

I have also noticed that I have installed image, yet as I tried to use

import image

A message 'ModuleNotFoundError: No module named 'image'' appeared.

May anyone help me out? Thanks a lot.

Upvotes: 0

Views: 498

Answers (1)

Josef
Josef

Reputation: 1532

Only the package is called Pillow, not the module you use in your source. You still have to use

from PIL import Image

If you have Pillow installed and not PIL, this will use Pillow

Upvotes: 1

Related Questions