Reputation: 11
I'm new in python; I install the pillow package with pip and try to import that in my code but when I run the code it's shows AttributeError: module PIL has no attribute Image. here is my code: import PIL
with PIL.Image.open("before1.jpg") as Im:
Im.show()
I reinstall python and pillow but nothing change; I try it with pillow 8.0.0 but nothing change; previously I have same problem with pytest
Upvotes: 1
Views: 672
Reputation: 116
You need to import it like this
from PIL import Image
so that it can find the Image class
Upvotes: 1