2

I am currently working on a EDA Project using ydata_profiling library.

This is the code i have written as of now:

import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport

profile = ProfileReport(df, title='Pandas Profiling Report', explorative=True)

profile.to_widgets() 

On displaying this .to_widgets() code, a summary of my data appears, but under the variables section i get this javascript error:

[Open Browser Console for more detailed log - Double click to close this message]
Model class 'AccordionModel' from module '@jupyter-widgets/controls' is loaded but can not be instantiated
Error: widget model not found 
at f.get_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:3460)
    at P (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:6289)
    at Object.P [as deserialize] (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:6099)
    at kt._deserialize_state (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:12378)
    at f._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:7932)
Report generated by YData.

I would really appreciate some suggestions or fixes for this.

Solution: Please don't overlook updating the version of your jupyter notebook. I updated the entire jupyter notebook environment and reloaded and issue got resolved. Run commands like :

jupyter notebook --version

pip install --upgrade notebook
7
  • Does this answer your question? Jupyter Lab issue displaying widgets (javascript error). Looks like your problem has nothing to see with ydata_profiling but all with jupyter widgets. Commented Mar 26, 2024 at 10:48
  • My ipywidget Version: 7.8.1 should i update then ? Also now my report is not being generated at all using pandas profiling..i think i ran some wrong commands. Please click on this link to see my problem, please help : stackoverflow.com/questions/78224554/… Commented Mar 26, 2024 at 11:10
  • 1
    Thank You Oca! That link you happened to paste helped me Commented Mar 26, 2024 at 13:55
  • It just hepled me render the report again as i ran the command : pip install -U ipywidgets But im facing this error still which is different from that link as it says : Model class 'AccordionModel' from module '@jupyter-widgets/controls' is loaded but can not be instantiated Error: widget model not found Commented Mar 26, 2024 at 14:18
  • 1
    Thank you so much Oca !!! Turns out it was a simple notebook update it needed. Very stupid mistake. But thankful for you help ! Commented Mar 26, 2024 at 16:02

1 Answer 1

0

Jupyter Lab issue displaying widgets (javascript error) received several relevant answers, none of them being a definite answer on its own. This suggests:

So, first step is making sure the whole environment is up to date, starting with conda, then Jupyter and ipywidgets.


A couple notes:

  • Caution: Because you are using conda, do stick to conda and not mix in some pip commands, because those are not going to install things at the same location, so you're asking for trouble.
  • Since you're updating, consider making the move from Jupyter to JupyterLab.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.