Billwilliams1952 / PiCameraApp

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

Error initializing Tkinter! #16

Open FoysalM opened 4 years ago

FoysalM commented 4 years ago

Hello,

I'm trying to run the application, but I'm getting the following error when running the startup command:

running....
No protocol specified
No protocol specified
Error initializing Tkinter!

Shutting down

Press any key
Traceback (most recent call last):
  File "PiCameraApp.py", line 1104, in Run
    win = Tk()
  File "/usr/lib/python3.7/tkinter/__init__.py", line 2023, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":10.0"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "PiCameraApp.py", line 1130, in <module>
    Run()
  File "PiCameraApp.py", line 1107, in Run
    raw_input()
NameError: name 'raw_input' is not defined

I'm quite new RPi and Python so still getting to grips with it all. Thanks in advance,

Kunthan commented 4 years ago

Hello, I have the same issue. Did you find a solution? Thank you

andrewrice commented 2 years ago

Hi, I'm having the same issue. Did you ever resolve it @FoysalM?

Mitchellscot commented 2 years ago

Have you guys tried python3 and not just python (I had that issue once)

FoysalM commented 2 years ago

Hi, I'm having the same issue. Did you ever resolve it @FoysalM?

@andrewrice My project was a lockdown one, and I've not gone back to it since encountering this problem, so unfortunately not. But it seems as mentioned above, Python3 might be the way to go? Not sure when I'll get a chance to test it, but if you have any success, please do post it here and mark this issue as resolved.

andrewrice commented 2 years ago

Hi, it seems the issue I was having is related to trying to execute it via Remote Desktop (from a Windows 10 machine). When I tried just now to run it in a native session directly on the Pi with mouse and keyboard, it worked as expected.

I presume the issue has to do with the application not knowing how to render the camera display in a remote desktop session.

@FoysalM, do you remember if you were using remote desktop when the error occurred?

jyang526843 commented 1 year ago

I searched online and it works for me: for python3, you need to use "input()" instead of "raw_input()"