You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For new users of my custom widget, the experience of seeing a JS based error saying "widget: model not found" is frustrating and confusing.
I want to display a message like
"You seem to have installed Buckaroo after you started your jupyterlab server, please restart your jupyter lab server for buckaroo to function properly"
From my understanding the python package installs properly, but the js is registered as a lab extenstion. By checking the server start time, and the package MTime, we can decide if a user is in this state and message appropriately when the package is imported or the widget used.
I don't know how to find the controlling jupyterlab server, and have filed a bug asking for help with that.
After more investigation I was able to make this work.
parent_process = psutil.Process().parent()
server_start_time = dtdt.fromtimestamp(parent_process.create_time())
buckaroo_mtime = dtdt.fromtimestamp(os.path.getmtime(__file__))
if buckaroo_mtime > server_start_time:
print("""It looks like you installed Buckaroo after you started this notebook server. If you see a message like "Failed to load model class 'DCEFWidgetModel' from module 'buckaroo'", restart the jupyter server and try again. If you have furter errors, please file a bug report at https://github.com/paddymul/buckaroo""")
print("buckaroo_mtime", buckaroo_mtime, "server_start_time", server_start_time)
For new users of my custom widget, the experience of seeing a JS based error saying
"widget: model not found"
is frustrating and confusing.I want to display a message like
From my understanding the python package installs properly, but the js is registered as a lab extenstion. By checking the server start time, and the package MTime, we can decide if a user is in this state and message appropriately when the package is imported or the widget used.
I don't know how to find the controlling jupyterlab server, and have filed a bug asking for help with that.
This code will be useful for all custom widgets.
jupyterlab/jupyterlab#15918
The text was updated successfully, but these errors were encountered: