Possible Duplicate:
img = Image.open(fp) AttributeError: class Image has no attribute ‘open’
So I am trying to view pictures in python with tkinter. I installed PIL and I am trying to open a picture but I keep getting an attribute error saying “class Image has no attribute ‘open’
from __future__ import division
from PIL import Image
from Tkinter import *
import random
img = Image.open("majestic creature.jpeg").convert("RGB")
This isn’t all the code I have but this is the part that the program seems to have trouble with.
From the looks of what you have said, namely
This is not all of the code.You or some other import has declared some variable / class called
Imageand this has overwritten theImageclass that was imported byPIL.To specifically use the
PILImageclass use: