to preface , I've already visited this issue, this question and also this question but none of these solved my problem.
I'm currently on the eclipse environment and am using the anaconda python interpreter in my project. I have this piece of code:
from PIL import Image, ImageTk
# other imports
# ....
# def initUI(self):
pic1 = Image.open("pic1.jpg")
pic1_img = ImageTk.PhotoImage(pic1)
label1 = Label(self, image=pic1_img)
label1.image = pic1_img
label1.place(x=20, y=20)
Now upon running I get this output
Traceback (most recent call last):
File "C:\Users\...\workspace\Tkinter_tutorial\absolutePositioning.py", line 46, in <module>
main()
File "C:\Users\...\workspace\Tkinter_tutorial\absolutePositioning.py", line 42, in main
app = Window(root)
File "C:\Users\...\workspace\Tkinter_tutorial\absolutePositioning.py", line 12, in __init__
self.initUI()
File "C:\Users\....\workspace\Tkinter_tutorial\absolutePositioning.py", line 22, in initUI
pic1_img = ImageTk.PhotoImage(pic1)
File "C:\Users\....\Anaconda\lib\site-packages\PIL\ImageTk.py", line 116, in __init__
self.paste(image)
File "C:\Users\....\Anaconda\lib\site-packages\PIL\ImageTk.py", line 181, in paste
import _imagingtk
ImportError: No module named _imagingtk
I've tried conda install Pillow
, and the package is marked as already installed. Yet I continue to get this error. I'm running window 64 bit python 2.7. Has anyone else encountered this problem, and how can I fix it? Thanks