Chciałem zacząć używać Tkinter z Pythona i mieć następujący kod:ImportError: No module o nazwie _imagingtk
#!/usr/bin/python
from Tkinter import *
from PIL import ImageTk, Image
top = Tk()
dir(top)
top.title("Erstes Frame")
erstesFrame = Frame(top, height=250, width=250)
erstesFrame.pack_propagate(0)
erstesFrame.pack()
img = ImageTk.PhotoImage(Image.open("mario.gif"))
erstesBild = Label(erstesFrame, image = img)
erstesBild.pack()
top.mainloop()
Ale gdy próbuję go uruchomić, to po prostu daje mi ten błąd:
Traceback (most recent call last):
File "ToDoAPP.py", line 14, in <module>
img = ImageTk.PhotoImage(Image.open("mario.gif"))
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageTk.py", line 116, in __init__
self.paste(image)
File "/usr/local/lib/python2.7/dist-packages/PIL/ImageTk.py", line 181, in paste
import _imagingtk
ImportError: No module named _imagingtk
Zainstalowałem PIL z python-pip, a mój system operacyjny to Ubuntu 12.04, a mój python w wersji 2.7.3.
Czy można go zainstalować przez pip? – dm76
@ dm76, Przepraszam, nigdy tego nie próbowałem. Nie jestem pewny. – falsetru
Mam już pakiet, wersja: 2.6.1-2, i nadal otrzymuję błąd. – appas