Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pillow installed but still say "No module named 'Pillow'" #3117

Closed
ahmedelbendary opened this issue Apr 29, 2018 · 11 comments
Closed

Pillow installed but still say "No module named 'Pillow'" #3117

ahmedelbendary opened this issue Apr 29, 2018 · 11 comments

Comments

@ahmedelbendary
Copy link

Actually i installed Pillow-5.1.0

so, when i import the module it should work

it gives me "No module named 'Pillow'"

Pillow-5.1.0 and Python 3.5

from tkinter import *
import tkinter as tk
import time
from Pillow import ImageTk, Image

root = tk.Tk()

pillow
error

@hugovk
Copy link
Member

hugovk commented Apr 29, 2018

You need to do:

from PIL import ImageTk, Image

See https://pillow.readthedocs.io/en/5.1.x/handbook/tutorial.html for examples.

Edit: fix typo.

@hugovk hugovk closed this as completed Apr 29, 2018
@ahmedelbendary
Copy link
Author

@hugovk Thank you but it work with
from PIL import ImageTk, Image

@1997showroom
Copy link

i have installed the latest pillow and i still get this error

@radarhere
Copy link
Member

@1997showroom if you are receiving the error "No module named 'Pillow'", that's because you should not be importing 'Pillow' - you should be importing 'PIL'.

@1997showroom
Copy link

@1997showroom if you are receiving the error "No module named 'Pillow'", that's because you should not be importing 'Pillow' - you should be importing 'PIL'.

So I have PIL and I am using python 3.7 I see a PIL folder in my 2.7 directory but not in 3.7
I downloaded homebrew also, I'm not sure if this made things worse or better.

@1997showroom
Copy link

@1997showroom if you are receiving the error "No module named 'Pillow'", that's because you should not be importing 'Pillow' - you should be importing 'PIL'.

Is pycharm just not finding Pillow, this is what I get from my terminal when I try to install pillow
Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (6.1.0)

@radarhere
Copy link
Member

I would guess that it's not finding it, yes. pip is telling that Pillow is already installed. If you would like to talk more about this, please create a new issue. Alternatively, since your situation doesn't indicate any fault in Pillow itself, you could ask on StackOverflow.

@1997showroom
Copy link

1997showroom commented Jul 21, 2019 via email

@rxvan
Copy link

rxvan commented Sep 3, 2020

Hey, i am kinda new to all this, i have installed pillow and it's saying "ModuleNotFoundError: No module named 'PIL'",
i run "pip install pillow" and get this: "Requirement already satisfied: pillow in c:\python37\lib\site-packages (7.2.0)",
Maybe i am doing something wrong? please, let me know, thanks.

also, what im doing is: "from PIL import Image" <- maybe that is wrong? im not sure, anyway, thanks in advance!

@radarhere
Copy link
Member

Hi @rxvan. If it's conceivable that you have more than one version of Python installed, then it is possible that pip and your Pillow import are running on different copies of Python.

If, for example, you are running

pip install Pillow
python3 script.py

then pip might not be attached to python3. To guard against this, you can run

python3 -m pip install --upgrade Pillow

This suggestion can also be seen at https://pillow.readthedocs.io/en/stable/installation.html#windows-installation

@BlitzJB
Copy link

BlitzJB commented Jan 24, 2022

from how they introduced Pillow in their docs, i thought it was an intendent library and depended on PIL. Thanks you guys for clarifying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants