可能重复:
img = Image.open(fp)AttributeError:class Image没有属性'open'
所以我试图用tkinter在python中查看图片.我安装了PIL并且我正在尝试打开图片但是我一直收到一个属性错误,说"类图像没有属性'打开'
from __future__ import division
from PIL import Image
from Tkinter import *
import random
img = Image.open("majestic creature.jpeg").convert("RGB")
Run Code Online (Sandbox Code Playgroud)
这不是我的所有代码,但这是程序似乎遇到麻烦的部分.