I am using jupyter notebook and installed
ipywidgets==7.4.2 widgetsnbextension pandas-profiling=='.0.0 and also I ran:
!jupyter nbextension enable --py widgetsnbextension but when runninhg
from pandas_profiling import ProfileReport profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True) profile.to_widgets() I get the error:
ImportError: IProgress not found. Please update jupyter and ipywidgets. See Any idea why? Tried proposed solutions.
4 Answers
I tried everything you mentioned in a new environment using conda and I had another issue related to the version of ipywidgets (a bug found in Github with comments saying that got solved after using last version). I solved the problem I had installing last version of ipywidgets. Here is my process:
- Create a new environment using
conda(I use miniconda):
conda create --name teststackoverflow python=3.7 - Activate new environment:
conda activate teststackoverflow - Install
jupyter:
pip install jupyter - Install all the libraries without specific versions to get the last ones:
pip install ipywidgets widgetsnbextension pandas-profiling - Run
jupyter notebookin the console to turn on the notebooks server and create a new notebook. - Run this line in a new cell:
!jupyter nbextension enable --py widgetsnbextension With the result:
Enabling notebook extension jupyter-js-widgets/extension... - Validating: OK - Run some sample code to define
df:
import pandas as pd df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [1, 2, 3, 4]}) - Run the code you provided:
from pandas_profiling import ProfileReport profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True) profile.to_widgets() 4this had worked for me (for all of you who prefer pip instead of conda..) in your virtualenv run
pip install ipywidgets jupyter nbextension enable --py widgetsnbextension or, if you prefer to run it in your notebook
!pip install ipywidgets !jupyter nbextension enable --py widgetsnbextension and in your notebook add
from ipywidgets import FloatProgress Installing ipywidgets and building Jupyter Lab did the trick for me.
- Make sure you activate the correct conda environment
- Install ipywidgets:
conda install -c conda-forge ipywidgets - To build Jupyter Lab, you need to have nodejs > 12.0.0 installed. Check the latest version number from Anaconda website and install nodejs specifying the package number e.g.
conda install -c conda-forge nodejs=16.6.1 - Stop Jupyter Lab
- Build Juyter Lab:
jupyter lab build - Start Jupyter Lab
I ran into the same error within the jupyter lab and I just installed ipywidgets using conda install -c conda-forge ipywidgets command.
