from tkinter import *
from PIL import Image, ImageTk
root = Tk()
root.geometry("1255x944")
photo = PhotoImage(file="photo.png")
lab = Label(image=photo)
lab.pack()
root.mainloop()
这是我的代码
错误是:
Traceback (most recent call last):
File "/home/itachi/PycharmProjects/GUI_course/gui1_initialize.py", line 3, in <module>
from PIL import Image, ImageTk
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 60, in <module>
from . import _imaging as core
ImportError: cannot import name '_imaging' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
Process finished with exit code 1