Select to view content in your preferred language

tkinter in notebooks for ArcGIS Online

1578
3
04-13-2020 03:24 PM
Labels (1)
RobertWeber
New Contributor III

Keep getting this error when trying to use tkinter in arcgis notebooks hosted in ArcGIS Online.

TclError: no display name and no $DISPLAY environment variable

From what I have seen it this is an environment variable that needs to be set in the docker image.  Using %env DISPLAY= does change variable but doesn't seem to clear up the issue.  I will then get this error:

TclError: couldn't connect to display ":0.0"

Since I do not have the control to alter these docker images used for Notebooks in ArcGIS Online I am wondering if someone from ESRI can look into this so tkinter works in notebooks for AGOL. 

My program runs fine when I run it from a jupyter notebook on my local machine.

ArcGIS Notebooks Beta - Online

0 Kudos
3 Replies
by Anonymous User
Not applicable

Hi Robert,

Can I ask what are you using TkInter for? TkInter requires a direct connection to a display, virtual or otherwise. You won't be able to present a GUI in AGOL Notebooks as it is a headless environment.

Josh

0 Kudos
RobertWeber
New Contributor III

Hey Josh - wanted to provide a UI for users of certain notebooks is all really.  It's not a huge deal but would be nice.  If there is another package you are aware of that can accomplish this using the runtime's available in AGOL I am open to suggestions.  I was thinking along the lines of taking an input from dropbox and add, publish, append etc an item. 

0 Kudos
by Anonymous User
Not applicable

Hi Robert,

I'm personally not too familiar with related packages, but have you looked into using ipywidgets to simulate a UI? You can create radio buttons, dropdowns, display videos.

https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20List.html#Selection-widgets 

I'm not entirely sure if that fits your use-case but it could be worth mentioning. Perhaps populate a drop-down with your dropbox items. I hope it's at least a good starting point.

Josh

0 Kudos