Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to display Jupyter Widget of type HBox #451

Closed
sumtopmus opened this issue Sep 28, 2017 · 18 comments
Closed

Failed to display Jupyter Widget of type HBox #451

sumtopmus opened this issue Sep 28, 2017 · 18 comments
Assignees
Labels
question/docs ‽ Documentation clarification candidate submodule-notebook 📓 Much web such IDE

Comments

@sumtopmus
Copy link

sumtopmus commented Sep 28, 2017

Getting this message when running a loop with tnrange:

for i in tnrange(10):
    print(i)

Failed to display Jupyter Widget of type HBox.
If you're reading this message in Jupyter Notebook or JupyterLab, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another notebook frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.

Was working fine yesterday, not even sure what is different today. Here is the same issue mentioned in bstriner/keras-tqdm#18.

MacOS X 10.13
Chrome 61.0.3163.100
Python 3.6.2 (virtualenv)
Jupyter 4.3.0
ipython 6.2.0
ipykernel 4.6.1
ipywidgets 7.0.1
widgetsnbextension 3.0.3
tqdm 4.17.1

@casperdcl casperdcl added the submodule-notebook 📓 Much web such IDE label Sep 28, 2017
@chengs
Copy link
Contributor

chengs commented Oct 14, 2017

Is your notebook untrusted?
You shall trust the notebook to make JS widgets loaded correctly.

@sumtopmus
Copy link
Author

The issue mysteriously disappeared so I cannot check that now. But probably you are right, it became trusted and everything started working again. I guess you can close the issue because I have no idea how to reproduce it.

@casperdcl
Copy link
Sponsor Member

such transience much superficial fun temperamental lol

@kkaiser
Copy link

kkaiser commented Oct 23, 2017

I still have this issue also with trusted notebooks.

tqdm-4.19.4
widgetsnbextension==3.0.6
ipykernel==4.6.1
ipython==6.2.1
ipywidgets==7.0.3
notebook-5.2.0

EDIT: It seems to be unrelated to tqdm I downgraded to ipywidgets==6.0.0 and it works again not sure at what version it actually breaks.

@kwierman
Copy link

I'm still having this issue and it persists through a number of versions, including all those listed above. Why was this closed?

@chengs
Copy link
Contributor

chengs commented Nov 21, 2017

It may not be the problem of tqdm.
@kkaiser @kwierman try this code in the jupyter-notebook. If it works properly, you will see a progress bar. If not, you need to check the installation of ipywidgets

from ipywidgets import IntProgress
IntProgress(10,max=100)

@casperdcl
Copy link
Sponsor Member

@kwierman judging by all the comments, this definitely appears to be an upstream issue. You should probably search and/or open an issue at https://github.com/jupyter/notebook/issues?q=tqdm

@kwierman
Copy link

@chengs @casperdcl Much thanks. IntProgress shows the same error. Definitely upstream.

@nilday
Copy link

nilday commented Feb 13, 2018

Has anyone solve the problem?

@chengs
Copy link
Contributor

chengs commented Feb 14, 2018

@nilday actually, this is not a problem of tqdm. according to my experience, the problem can be solved in most of cases by updating the jupypter and ipython to their latest versions and then reinstalling the ipywidgets (https://github.com/jupyter-widgets/ipywidgets). Wish this could help.

P.S. 春节还工作啊?辛苦辛苦啊

@kwierman
Copy link

@nilday @chengs . On my end, it looks like an update to jupyter has solved the problem. I think this issue can be closed.

@casperdcl
Copy link
Sponsor Member

If anyone can suggest which versions do/don't work (so we can create a requirements-notebook.txt) that would be great

@Bubblbu
Copy link

Bubblbu commented Feb 21, 2018

Updating jupyter/ipython & reinstalling ipywidgets did not work for me, until I realised that I had not installed the JupyterLab Extension for Jupyter Widgets.

jupyter labextension install @jupyter-widgets/jupyterlab-manager according to Jupyter Widgets docs solved the problem for me.

@ehsanfathi77
Copy link

try this for running jupyter:
python -m IPython notebook

it solved my problem.

@zhengjxu
Copy link

zhengjxu commented Apr 6, 2019

jupyter nbextension enable --py widgetsnbextension this works for me

@gferon
Copy link

gferon commented Apr 23, 2019

jupyter nbextension enable --py widgetsnbextension this works for me

It also solved the issue for me, maybe it should be mentioned in the doc? I can open a quick PR if people here agree.

@casperdcl
Copy link
Sponsor Member

because of https://github.com/tqdm/tqdm/blob/master/tqdm/_tqdm_notebook.py#L111-L113 you should get an ImportError mentioning https://ipywidgets.readthedocs.io/en/stable/user_install.html which in turn says

# pip
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension # --sys-prefix # if in venv
# conda
conda install -c conda-forge ipywidgets

and possibly jupyter labextension install @jupyter-widgets/jupyterlab-manager.

@casperdcl casperdcl self-assigned this Apr 23, 2019
@casperdcl casperdcl added the question/docs ‽ Documentation clarification candidate label Apr 23, 2019
@gingeard
Copy link

gingeard commented Feb 3, 2020

I've tried to install a clean environment with Python 3.8.1 and it's work. With Python 3.7.1, but with the same versions of packages, I was seeing only "HBox..." instead of widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/docs ‽ Documentation clarification candidate submodule-notebook 📓 Much web such IDE
Projects
None yet
Development

No branches or pull requests