Billwilliams1952 / PiCameraApp

A graphical interface for programming the Raspberry Pi PiCamera. Written in Python using Tkinter.
280 stars 66 forks source link

Cannot import ImageTk #20

Open lumberjackjm opened 2 years ago

lumberjackjm commented 2 years ago
pi@raspberrypi:~/Desktop/PiCameraApp-master/Source $ sudo python3 PiCameraApp.py
Traceback (most recent call last):
  File "PiCameraApp.py", line 38, in <module>
    from    AnnotationOverlay   import *
  File "/home/pi/Desktop/PiCameraApp-master/Source/AnnotationOverlay.py", line 52, in <module>
    from    Dialog  import *
  File "/home/pi/Desktop/PiCameraApp-master/Source/Dialog.py", line 43, in <module>
    from PIL import Image, ImageTk, ExifTags
ImportError: cannot import name 'ImageTk' from 'PIL' (/usr/lib/python3/dist-packages/PIL/__init__.py)
Bruno-noronha-seeds commented 2 years ago

Hi, I also had the same problem. Looks like the code was only tested on python2 So when I run the code line: sudo apt-get install python3-pil.imagetk in the terminal, and then run the code, it runs normally.

I hope it helps!

PatrichCerpa commented 2 years ago

Thanks a lot, it works for me!

rahulmotiyar commented 9 months ago

After 2 hours of struggle, i landed here and i am thankful to you

kidlat14 commented 2 months ago

Hi, I also had the same problem. Looks like the code was only tested on python2 So when I run the code line: sudo apt-get install python3-pil.imagetk in the terminal, and then run the code, it runs normally.

I hope it helps!

OMG. I've been struggling with this exact problem for at least 5 hours. Life is kinda cruel that the answer is already here and was posted two years ago. Thank you so much!