Is your JupyterLab install and packages being used here all 100% updated? If that is the case, I think you aren’t connecting properly your widget out
back to the notebook. You cannot just use print with widgets. For debugging you can and JupyterLab trying to handle not 100% proper channeling is what you are seeing; however, to not get what you are seeing in JupyterLab, you need to handle that properly and link it to an output
area. I think this reply by @jasongrout is advice for a similar situation, especially the last line. Obviously the specifics are different because you aren’t trying to capture markdown, just text, but you need to link it back to a display of an output widget in the widget layout.
Specifically, I think this example code in cell #2 and #3 point to what you need to rework your function to do. You need to add in the context manager to your run_service
function. To do it like that, you need to have assigned your widgets.Output()
somewhere, too. I think my comment here as part of that chain is pertinent to this. Presently, the Jupyter notebook classic interface is a little more forgiving when not properly handling widget output. Importantly, you’ll have more resilent code if you update to the more modern way widgets output is handled; I suspect the notebook classic interface won’t be as forgiving when the newer version of what is presently the classic interface has the similar underlying machinery as JupyterLab, which is the plan going forward.