Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import ImageTk #20

Open
lumberjackjm opened this issue Dec 8, 2021 · 4 comments
Open

Cannot import ImageTk #20

lumberjackjm opened this issue Dec 8, 2021 · 4 comments

Comments

@lumberjackjm
Copy link

lumberjackjm commented Dec 8, 2021

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
Copy link

Bruno-noronha-seeds commented Jan 7, 2022

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
Copy link

Thanks a lot, it works for me!

@rahulmotiyar
Copy link

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

@kidlat14
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants