1

I made a codespaces to work on gui based applications . But below error is showing. please guide me over this problem and how to make it work.

Traceback (most recent call last):
  File "/workspaces/CODSOFT/calculator.py", line 24, in <module>
    window = tk.Tk()
  File "/home/codespace/.python/current/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Traceback (most recent call last):
  File "/workspaces/CODSOFT/calculator.py", line 24, in <module>
    window = tk.Tk()
  File "/home/codespace/.python/current/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
3
  • Please provide enough code so others can better understand or reproduce the problem. Commented Jan 22, 2024 at 9:29
  • 1
    There is no physical monitor attached on a cloud platform, so GUI application cannot be executed unless the graphical rendering is redirected to somewhere else that has a physical monitor attached. Commented Jan 22, 2024 at 9:55
  • stackoverflow.com/questions/72676914/… has solutions for this when running under linux. Commented Jun 6, 2024 at 10:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.