Comments (7)
Back here with good news.
For some reason, trying to do this configuration directly from the notebook in one of the available kernels is not the way.
A teammate here tried some other configuration, and at the end, we managed to have it working.
By having these commands here on notebook start (via lifecycle policy, it's one of the sagemaker resources):
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python3 -m pip install yfiles_jupyter_graphs
/home/ec2-user/anaconda3/envs/python3/bin/python3 -m pip install yfiles_jupyter_graphs
The lib is installed both in the system default environment, and on the kernel that we are going to use on the notebook.
I assume that trying to do this directly from the notebook, was not properly installing the library on the desired environment. Because it seems that the jupyter application runs on top of the jupyter configuration of the system env. Don't know if it makes sense, but resolution is pretty simple (after spending some days and with help from others :D).
Anyways, thanks for your help @yGuy and @fskpf!
from yfiles-jupyter-graphs.
This may sound like poor advice, but did you actually try to simply reload the page in the browser?
When a new widget gets installed on the kernel that uses JavaScript, the default jupyter notebook implementation does not manage to update the state of the widget registry in the browser. So restarting the kernel may not only be not enough, but actually the wrong tip. It only updates the data structures in the kernel but still doesn't update the widget registry.
So could you simply reload the browser and see if that helps?
I only ever saw this problem when installing the widget in the kernel and using it directly in the same browser session. This doesn't happen with Google Colab, e.g., because it dynamically fetches the widget from a CDN rather than loading it from the local kernel via the local registry.
I think we should copy that "important" bit from here: https://stackoverflow.com/a/60059786/351836
This is what phind.com had to say about this:
Yes, it is correct that after installing Jupyter widgets, you may need to reload the browser to make them work and appear in the widget registry. This is because the widgets rely on JavaScript libraries that are loaded by the browser. When you install or update these libraries, the browser needs to refresh its cache to recognize the new or updated widgets. This process ensures that the widgets are properly integrated into the Jupyter environment and can be interacted with as intended.
from yfiles-jupyter-graphs.
Hey, @yGuy .
Thanks for reaching out. I have tried a different browser (Safari), also refreshing and force refreshing the page, but no success.
Also, under the Manager Extension tab, i have installed the plugin from there, no success, too. :(
from yfiles-jupyter-graphs.
:-( - I don't know enough about how Sagemaker could be different from a regular jupyter notebook server.
Just yesterday I used this super simple docker image on my local machine:
FROM jupyter/scipy-notebook
RUN pip install yfiles-jupyter-graphs
With (what I think) is the most recent versions of the base image and our plugin and it still worked flawlessly for me.
This results in this configuration:
Python 3.11.6
JupyterLab v4.0.7
/opt/conda/share/jupyter/labextensions
jupyterlab_pygments v0.2.2 enabled X (python, jupyterlab_pygments)
yfiles-jupyter-graphs v1.6.2 enabled OK (python, yfiles_jupyter_graphs)
nbdime-jupyterlab v2.2.0 enabled X
jupyter-matplotlib v0.11.3 enabled OK
@jupyter-notebook/lab-extension v7.0.6 enabled OK
@jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)
@jupyterlab/git v0.41.0 enabled X (python, jupyterlab-git)
The following extensions are outdated:
jupyterlab_pygments
nbdime-jupyterlab
@jupyterlab/git
Consider checking if an update is available for these packages.
Other labextensions (built into JupyterLab)
app dir: /opt/conda/share/jupyter/lab
It seems the docker base image is not up to date and your stack is slightly newer.
If you look at the developer console, is there anything suspicious?
And if there isn't:
Do you think you could provide me or my team with temporary access to such an installation.
from yfiles-jupyter-graphs.
Maybe this comment or thread helps? matplotlib/ipympl#460 (comment)
from yfiles-jupyter-graphs.
I won't be able to share these installations, but it's the default environments of Sagemaker Notebooks, just some clicks to have it up and running.
I tried some procedures on this link, couldn't have it working.
There is other possible image, Amazon Linux 2, Jupyter Lab 1(notebook-al2-v1), which the Widget object can be created, but it simply does not render anything.
from yfiles-jupyter-graphs.
A similar issue was discussed here jupyter-widgets/ipywidgets#2220 with different solutions, all related to the setup of the environment.
Here as well https://forums.fast.ai/t/ipywidgets-not-displaying-on-aws-sagemaker-fastai/85039
And another discussion here: https://stackoverflow.com/questions/36351109/ipython-notebook-ipywidgets-does-not-show
Maybe something like this or that does the trick.
Seems like ipywidgets + sagemaker is a tricky setup.
from yfiles-jupyter-graphs.
Related Issues (20)
- Feature: Provide more styling options for labels
- Feature request: actions/callbacks for selected nodes HOT 1
- Feature Request: being able to drag selected nodes HOT 1
- Render an image of the graph when I view my notebook in GitHub or export the notebook as PDF HOT 5
- [Question] how to render this widget inside streamlit? HOT 1
- Unsupported host error is not readable in dark-theme HOT 1
- Add a dark mode to the widget HOT 1
- New version not working HOT 2
- Error: No version of module yfiles-jupyter-graphs is registered HOT 5
- Document ways to customize default graph imports
- For very large graphs, offer DataExplorer view
- Allow hierarchically nested graphs.
- Graph is invisible HOT 3
- Showing too many instances can crash WebGL2 browser engine
- Feature request: Full screen visualization only HOT 1
- Feature: use the smart navigation feature from the yfiles demos
- Feature - navigate in the neighborhood
- Failed to load model class 'GraphModel' from module 'yfiles-jupyter-graphs' HOT 2
- Broken links in documentation page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yfiles-jupyter-graphs.