37

I installed the Pillow package with:

python -m pip install pillow

Got success message (Successfully installed pillow). Closed and re-opened the terminal.

But when I try to:

import pillow

I get the error message:

ImportError: No module named pillow

If python -m pip install pillow is run again, it says

Requirement already satisfied (use --upgrade to upgrade): pillow in c:\python27\lib\site-packages

1 Answer 1

62

Try using

import PIL

or

from PIL import ...

instead. Pillow is a fork of PIL, the Python Imaging Library, which is no longer maintained. However, to maintain backwards compatibility, the old module name is used.

2
  • 1
    no module named PIL Mar 18, 2022 at 10:21
  • 1
    @user7082181 did you successfully run pip install pillow and are you using the same interpreter used to install it?
    – MattDMo
    Mar 19, 2022 at 10:30

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.