Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tk error when starting widget in a headless environment #32

Open
jonashaase opened this issue Feb 23, 2022 · 0 comments
Open

Tk error when starting widget in a headless environment #32

jonashaase opened this issue Feb 23, 2022 · 0 comments

Comments

@jonashaase
Copy link

Hi

Starting the widget inside a notebook running inside a headless docker container currently yields an error.
I see the initialisation has changes recently regarding how Tk is used.
Is there a way the environment has to be set up in the container so this works again?
Or could this perhaps again be made agnostic towards whether or not a display exists?

cheers
Jonas

TclErrorTraceback (most recent call last)
<ipython-input-1-0616404e5e7e> in <module>
      1 from pyesasky import ESASkyWidget
----> 2 esasky = ESASkyWidget()
      3 esasky

~/miniconda3/lib/python3.8/site-packages/pyesasky/pyesasky.py in __init__(self, lang)
     47     def __init__(self, lang = 'en'):
     48         super().__init__()
---> 49         tk = Tk()
     50         tk.withdraw()
     51         tk.call('wm', 'attributes', '.', '-topmost', True)

~/miniconda3/lib/python3.8/tkinter/__init__.py in __init__(self, screenName, baseName, className, useTk, sync, use)
   2268                 baseName = baseName + ext
   2269         interactive = 0
-> 2270         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
   2271         if useTk:
   2272             self._loadtk()

TclError: no display name and no $DISPLAY environment variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant