import os import tkinter as tk from tkinter import * from tkinter import Image import canvas win = tk.Tk() win.geometry(f"400x500+100+200") win.title('StartupGames') # кнопки def Discord(): os.startfile('C:/Users/kotai/AppData/Local/Discord/app-1.0.9007/Discord.exe') button1 = tk.Button(win, text='Start discord', command=Discord ) button1.pack() image = PhotoImage(Image.open("logo.png")) canvas.create_image(0, 0, anchor=NW, image=image) canvas.pack() win.mainloop()
Вот ошибка которая при запуске
Traceback (most recent call last): File "D:\Python Project`s\ReadyPython\main.py", line 21, in <module> image = PhotoImage(Image.open("logo.png")) AttributeError: type object 'Image' has no attribute 'open'