-
Notifications
You must be signed in to change notification settings - Fork 362
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
Using ipyleaflet with Amazon SageMaker Studio Lab - Error displaying widget: model not found #1034
Comments
CC @jweill-aws |
Thanks for reporting this! I've informed the SageMaker Studio Lab team. |
Hi- try installing with a % instead of a !. See Studio Lab FAQ below. Q: How can I install open-source Python packages? To install Python packages, you can use ‘%pip install ’ or ‘%conda install ’ in any notebook. Please make sure to use this form (with ‘%’) instead of ‘!pip’ and ‘!conda.’ Using the ‘%’ ensures you are installing the packages in the correct path. |
@giswqs There is no "reset" button in Studio Lab just yet. If you would like to reset your account, you can delete your account and register again. You will not have to wait for another approval as long as you use the same information when you register again. |
I'll just point out that your labextension list indicates it installed ipywidgets 8, and ipyleaflet is not yet compatible with ipywidgets 8. That may be why it had an error displaying. We're working on ipywidgets 8 compatibility over in #968, and it should be coming soon. |
@jasongrout where did you see ipywidgets 8? I only see from https://user-images.githubusercontent.com/5016453/185829006-bc1d5b25-03ad-4b32-8270-4a063547b9d1.png: JupyterLab v3.2.4 |
This is the version of the widgets manager that comes with ipywidgets 8. FYI, ipyleaflet now supports ipywidgets 8. |
@MicheleMonclova @JasonWeill I tested ipyleaflet on three SageMaker platforms, including SageMaker, SageMaker EC2 notebook instance, and SageMaker Studio Lab. Unfortunately, none of them work. Any advice? |
I tried it on SageMaker Studio Lab. I can see that now the extentions have been installed successfully, but ipyleaflet still does not work. Any advice? |
What do you see in the js console? |
@maartenbreddels You are a life saver! I can confirm that it works with the normal SageMaker now. Not sure what's the issue with the Studio Lab, but at least the normal SageMaker is working now. This is exciting! |
Great. There are quite a few gems in solara :) I'll fix solara, because it should do this check always when importing. It would be great if all ipywidget libraries would be checked this way. |
That would be nice! This have been a long standing for over two years. So happy to see that we finally have a solution. Thank you very much. |
Found out in jupyter-widgets/ipyleaflet#1034 that we think the server is running because solara.server is imported. For this reason, we do not check any of the widget extensions.
Ok, I got it working on Studio Lab as well. Include this patch:
After that, the install command was correct, and executed in a cell
After that, ipyleaflet worked for me |
Found out in jupyter-widgets/ipyleaflet#1034 that we think the server is running because solara.server is imported. For this reason, we do not check any of the widget extensions.
Here are the steps I used to fix the issue on the normal SageMaker. It works like a charm.
import solara
# a bug in solara, so we monkey patch it
solara._using_solara_server = lambda: False
# pass in updated module names (next release of solara we should also fix this)
libraries_extra = [
{"python": "bqplot", "classic": "bqplot/extension", "lab": "bqplot"},
{"python": "ipyvolume", "classic": "ipyvolume/extension", "lab": "ipyvolume"},
{"python": "ipywebrtc", "classic": "jupyter-webrtc", "lab": "jupyter-webrtc"},
{"python": "ipyleaflet", "classic": "ipyleaflet/extension", "lab": "jupyter-leaflet"},
]
solara.checks.check_jupyter(silent=False, force=True, extra=True, libraries_extra=libraries_extra)
!/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python3.10 -m pip install ipyvuetify ipyvue bqplot ipyvolume ipywebrtc ipyleaflet anywidget
import solara
# a bug in solara, so we monkey patch it
solara._using_solara_server = lambda: False
# pass in updated module names (next release of solara we should also fix this)
libraries_extra = [
{"python": "bqplot", "classic": "bqplot/extension", "lab": "bqplot"},
{"python": "ipyvolume", "classic": "ipyvolume/extension", "lab": "ipyvolume"},
{"python": "ipywebrtc", "classic": "jupyter-webrtc", "lab": "jupyter-webrtc"},
{"python": "ipyleaflet", "classic": "ipyleaflet/extension", "lab": "jupyter-leaflet"},
]
solara.checks.check_jupyter(silent=False, force=True, extra=True, libraries_extra=libraries_extra)
import leafmap
leafmap.Map()
import leafmap.maplibregl as leafmap
leafmap.Map() |
I did the same thing early this week and got it works. The step #6 and #7 are the keys.
|
Has anyone ever used ipyleaflet with Amazon SageMaker Studio Lab? I can't get it to work.
The text was updated successfully, but these errors were encountered: