Got a error while running the app in Docker

TclError: no display name and no $DISPLAY environment variable

Traceback:

File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)File "/sharuk/mainPage.py", line 9, in <module>
    root = tk.Tk()File "/usr/local/lib/python3.9/tkinter/__init__.py", line 2270, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)

As long as we don’t see the actual code we can only guess.
But in a headless environment you can’t use Tkinter or any other GUI library that requires a native GUI interface.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.