1

Getting the following error on a repl of mine (Tic-Tac-Toe GUI) where I'm using Tkinter.

Traceback (most recent call last):
  File "main.py", line 99, in <module>
    root = tk.Tk()
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0"

It was working up until yesterday.

This seems to be an error faced by people working on less popular Linux distros (local machine _tkinter.TclError: couldn't connect to display ":0") and the following update to the PATH variable seems to be fixing the issue.

export DISPLAY=unix$DISPLAY

Not sure why suddenly this became an issue, also, not sure how I can fix it on Replit. Any suggestions/help will be appreciated.

Bilesh Ganguly
  • 3,792
  • 3
  • 36
  • 58
  • Why not ask them?. Anyway I don't think this will be reproducible, because the DISPLAY value "unix:0" is equivalent to ":0". – relent95 Apr 06 '23 at 05:27

0 Answers0