ImportError: IProgress not found. Please update jupyter and ipywidgets although it is installed
Asked Answered
J

6

60

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 running:

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 https://ipywidgets.readthedocs.io/en/stable/user_install.html

Any idea why? Tried proposed solutions.

Jeramyjerba answered 16/6, 2021 at 7:27 Comment(0)
L
60

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:

  1. Create a new environment using conda (I use miniconda):
conda create --name teststackoverflow python=3.7
  1. Activate new environment:
conda activate teststackoverflow
  1. Install jupyter:
pip install jupyter
  1. Install all the libraries without specific versions to get the last ones:
pip install ipywidgets widgetsnbextension pandas-profiling
  1. Run jupyter notebook in the console to turn on the notebooks server and create a new notebook.
  2. Run this line in a new cell:
!jupyter nbextension enable --py widgetsnbextension

With the result:

Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: OK
  1. Run some sample code to define df:
import pandas as pd
df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [1, 2, 3, 4]})
  1. Run the code you provided:
from pandas_profiling import ProfileReport
profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True)
profile.to_widgets()

Final output looks good: Final result of running step number 8

Ludwog answered 21/6, 2021 at 19:32 Comment(6)
can u pls elaborate the versions of ipywidgets, widgetsnbextension, pandas-profiling that worked well for you?Jeramyjerba
Sure: ipywidgets==7.6.3, pandas-profiling==3.0.0 and widgetsnbextension==3.5.1. That's what you expected or do you need more information about how to install them?Ludwog
is it possible to export the report to pdf or html?Jeramyjerba
Yes, you can do profile.to_file("your_report.html"). If you want to download a PDF, just use the print function from the browser to save the HTML into a PDF. You can find more information here.Ludwog
Step 4 was the most important part for me. Thanks!Prog
Note that pandas-profiling package naming was changed. To continue profiling data use ydata-profiling insteadJabot
C
36

this 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
Chrissy answered 7/7, 2021 at 8:18 Comment(1)
I followed this solution but got AttributeError: 'tqdm_notebook' object has no attribute 'disp'Ulrikeulster
S
13

I ran into the same error. On M1 mac, I change from tqdm.notebook import tqdm as tqdm to from tqdm import tqdm. Hope it helps. Original post: https://github.com/CosmiQ/solaris/issues/392#issuecomment-759238485

Spawn answered 31/1, 2023 at 7:32 Comment(0)
B
6

I ran into the same error within the jupyter lab and I just installed ipywidgets using conda install -c conda-forge ipywidgets command.

Baroja answered 1/12, 2021 at 12:14 Comment(0)
N
5

Installing ipywidgets and building Jupyter Lab did the trick for me.

  1. Make sure you activate the correct conda environment
  2. Install ipywidgets: conda install -c conda-forge ipywidgets
  3. 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
  4. Stop Jupyter Lab
  5. Build Juyter Lab: jupyter lab build
  6. Start Jupyter Lab
Nae answered 17/8, 2021 at 10:52 Comment(0)
C
3

This bug has been fixed in latest update of jupyter. Please run this this command in terminal pip install --upgrade jupyter

Chisholm answered 14/1 at 9:19 Comment(1)
Can you please add a reference to git issues or a git commit record or somewhere indicating that this is the case so that it links to the specific versions and times that this was happening since this original post dates back to 2021?Scurvy

© 2022 - 2024 — McMap. All rights reserved.