我正在使用 jupyter 笔记本并已安装。
ipywidgets==7.4.2 widgetsnbextension pandas-profiling=='.0.0
我也跑了:
!jupyter nbextension enable --py widgetsnbextension
但是跑步时:
from pandas_profiling import ProfileReport
profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True)
profile.to_widgets()
我收到错误:
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
知道为什么吗? 尝试了建议的解决方案。
我在新环境中使用
conda
尝试了你提到的所有内容,并且遇到了与 ipywidgets
版本相关的另一个问题(在 Github 中发现的一个错误,评论说在使用上一个版本后已解决)。我解决了安装最新版本 ipywidgets
时遇到的问题。这是我的过程:
conda
创建一个新环境(我使用miniconda):conda create --name teststackoverflow python=3.7
conda activate teststackoverflow
jupyter
:pip install jupyter
pip install ipywidgets widgetsnbextension pandas-profiling
jupyter notebook
以打开笔记本服务器并创建一个新笔记本。!jupyter nbextension enable --py widgetsnbextension
结果:
Enabling notebook extension jupyter-js-widgets/extension...
- Validating: OK
df
:import pandas as pd
df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [1, 2, 3, 4]})
from pandas_profiling import ProfileReport
profile = ProfileReport(df, title="Pandas Profiling Report", explorative=True)
profile.to_widgets()
这对我有用(对于所有喜欢 pip 而不是 conda 的人..) 在你的 virtualenv 中运行
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
或者,如果您更喜欢在笔记本中运行它
!pip install ipywidgets
!jupyter nbextension enable --py widgetsnbextension
并在你的笔记本中添加
from ipywidgets import FloatProgress
安装 ipywidgets 并构建 Jupyter Lab 对我来说成功了。
conda install -c conda-forge ipywidgets
conda install -c conda-forge nodejs=16.6.1
jupyter lab build
我遇到了同样的错误。在 M1 mac 上,我将
from tqdm.notebook import tqdm as tqdm
更改为 from tqdm import tqdm
。希望能帮助到你。原帖:https://github.com/CosmiQ/solaris/issues/392#issuecomment-759238485
我在 jupyter 实验室中遇到了同样的错误,我刚刚使用
conda install -c conda-forge ipywidgets
命令安装了 ipywidgets。
此错误已在 jupyter 的最新更新中修复。请在终端中运行此命令
pip install --upgrade jupyter