Billwilliams1952 / PiCameraApp

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

Error on Startup (July 2020) #14

Open tmkkcc opened 4 years ago

tmkkcc commented 4 years ago

Here is a snippit of my command line, Im not very novice on this rpi quite yet but ive done my research on other "issues" and one seemed similar but wasnt quite what im getting. Im running a RPI4 4gb on raspbian, with updated and upgraded packages, running Python 3.7.3

pi@raspberrypi:~/Documents/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/Documents/PiCameraApp-master/Source/AnnotationOverlay.py", line 52, in <module> from Dialog import * File "/home/pi/Documents/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)

Thanks and stay safe!

simonachmueller commented 4 years ago

Seems like you don't have ImageTk python package installed. If running Python 3.x use: sudo apt-get install python3-pil.imagetk

hemmigumm commented 4 years ago

Seems like you don't have ImageTk python package installed. If running Python 3.x use: sudo apt-get install python3-pil.imagetk

I was experiencing the same issue. At the time I had the cameras connected to a multiplexer, which I guess the program doesn't like, but it gave me this error for some reason. When I connected the camera directly to the Pi, I no longer got this error, and everything worked fine.

I didn't dig deep into this issue and why I was getting this error, but perhaps this information helps.

simonachmueller commented 4 years ago

@hemmigumm are you sure you got the same exception? Because this failure happens when a python module tries to load an external library, so it should be not hardware related.

hemmigumm commented 4 years ago

@semenmiroshnichenko I am sure I was getting at least this part:

in from PIL import Image, ImageTk, ExifTags ImportError: cannot import name 'ImageTk' from 'PIL

But as I said, I didn't dig deep into the issue, so this could be nonsense. Now I'm kind of curious though, so I might re-test this soon to check if this was some trivial mistake by me.