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

ipywidgets < 8 e.g. 7.7 cannot be installed with pip #3558

Closed
bernhard-42 opened this issue Aug 20, 2022 · 8 comments
Closed

ipywidgets < 8 e.g. 7.7 cannot be installed with pip #3558

bernhard-42 opened this issue Aug 20, 2022 · 8 comments
Labels
answered The issue has been answered by a community member.

Comments

@bernhard-42
Copy link

Description

Installing ipywidgets 7.7 after jupyterlab leads to a non working ipywidgets environment (Javascript error)

Reproduce

Create a fresh environment with the latest Jupyterlab

mamba create -n ipyw python=3.9
mamba activate ipyw
pip install jupyterlab

This leads to

$ jupyter-labextension list
JupyterLab v3.4.5
/opt/anaconda/envs/ipyw/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)

Now, install ipywidgets 7.7:

pip install ipywidgets==7.7

$ jupyter-labextension list
JupyterLab v3.4.5
/opt/anaconda/envs/ipyw/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v5.0.2 enabled OK (python, jupyterlab_widgets)

And here we have the wrong dependency of @jupyter-widgets/jupyterlab-manager and ipywidgets is broken:

image

Downgrading jupyterlab-widgets to 1.1.1 will fix the environment

pip install jupyterlab-widgets==1.1.1
jupyter-labextension list
JupyterLab v3.4.5
/opt/anaconda/envs/ipyw/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v3.1.1 enabled OK (python, jupyterlab_widgets)

Now the version of @jupyter-widgets/jupyterlab-manager fits to ipywidgets 7.7

Expected behavior

pip install ipywidgets==7.7 should lead to a working environment.
Many existing custom widgets will not work with ipywidgets 8.0 out of the box.

Context

  • ipywidgets version 7.7.0
  • Operating System and version: Ubuntu 20.04.4 LTS
  • Browser and version: Brave 1.42.88
Troubleshoot Output
$PATH:
	/home/bernhard/bin
	/home/bernhard/.local/bin
	/opt/anaconda/envs/ipyw/bin
	/opt/anaconda/condabin
	/usr/local/sbin
	/usr/local/bin
	/usr/sbin
	/usr/bin
	/sbin
	/bin
	/usr/games
	/usr/local/games
	/snap/bin
	/opt/node/bin

sys.path:
/opt/anaconda/envs/ipyw/bin
/opt/anaconda/envs/ipyw/lib/python39.zip
/opt/anaconda/envs/ipyw/lib/python3.9
/opt/anaconda/envs/ipyw/lib/python3.9/lib-dynload
/opt/anaconda/envs/ipyw/lib/python3.9/site-packages

sys.executable:
/opt/anaconda/envs/ipyw/bin/python

sys.version:
3.9.12 (main, Jun 1 2022, 11:38:51)
[GCC 7.5.0]

platform.platform():
Linux-5.4.0-122-generic-x86_64-with-glibc2.31

which -a jupyter:
/opt/anaconda/envs/ipyw/bin/jupyter

pip list:
Package Version
-------------------- -----------
anyio 3.6.1
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asttokens 2.0.8
attrs 22.1.0
Babel 2.10.3
backcall 0.2.0
beautifulsoup4 4.11.1
bleach 5.0.1
certifi 2022.6.15
cffi 1.15.1
charset-normalizer 2.1.1
debugpy 1.6.3
decorator 5.1.1
defusedxml 0.7.1
entrypoints 0.4
executing 0.10.0
fastjsonschema 2.16.1
idna 3.3
importlib-metadata 4.12.0
ipykernel 6.15.1
ipython 8.4.0
ipython-genutils 0.2.0
ipywidgets 7.7.0
jedi 0.18.1
Jinja2 3.1.2
json5 0.9.10
jsonschema 4.13.0
jupyter-client 7.3.4
jupyter-core 4.11.1
jupyter-server 1.18.1
jupyterlab 3.4.5
jupyterlab-pygments 0.2.2
jupyterlab-server 2.15.0
jupyterlab-widgets 3.0.2
lxml 4.9.1
MarkupSafe 2.1.1
matplotlib-inline 0.1.6
mistune 0.8.4
nbclassic 0.4.3
nbclient 0.6.6
nbconvert 6.5.3
nbformat 5.4.0
nest-asyncio 1.5.5
notebook 6.4.12
notebook-shim 0.1.0
packaging 21.3
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pip 22.1.2
prometheus-client 0.14.1
prompt-toolkit 3.0.30
psutil 5.9.1
ptyprocess 0.7.0
pure-eval 0.2.2
pycparser 2.21
Pygments 2.13.0
pyparsing 3.0.9
pyrsistent 0.18.1
python-dateutil 2.8.2
pytz 2022.2.1
pyzmq 23.2.1
requests 2.28.1
Send2Trash 1.8.0
setuptools 61.2.0
six 1.16.0
sniffio 1.2.0
soupsieve 2.3.2.post1
stack-data 0.4.0
terminado 0.15.0
tinycss2 1.1.1
tornado 6.2
traitlets 5.3.0
urllib3 1.26.11
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.3.3
wheel 0.37.1
widgetsnbextension 3.6.1
zipp 3.8.1

conda list:
# packages in environment at /opt/anaconda/envs/ipyw:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
anyio 3.6.1 pypi_0 pypi
argon2-cffi 21.3.0 pypi_0 pypi
argon2-cffi-bindings 21.2.0 pypi_0 pypi
asttokens 2.0.8 pypi_0 pypi
attrs 22.1.0 pypi_0 pypi
babel 2.10.3 pypi_0 pypi
backcall 0.2.0 pypi_0 pypi
beautifulsoup4 4.11.1 pypi_0 pypi
bleach 5.0.1 pypi_0 pypi
ca-certificates 2022.07.19 h06a4308_0
certifi 2022.6.15 py39h06a4308_0
cffi 1.15.1 pypi_0 pypi
charset-normalizer 2.1.1 pypi_0 pypi
debugpy 1.6.3 pypi_0 pypi
decorator 5.1.1 pypi_0 pypi
defusedxml 0.7.1 pypi_0 pypi
entrypoints 0.4 pypi_0 pypi
executing 0.10.0 pypi_0 pypi
fastjsonschema 2.16.1 pypi_0 pypi
idna 3.3 pypi_0 pypi
importlib-metadata 4.12.0 pypi_0 pypi
ipykernel 6.15.1 pypi_0 pypi
ipython 8.4.0 pypi_0 pypi
ipython-genutils 0.2.0 pypi_0 pypi
ipywidgets 7.7.0 pypi_0 pypi
jedi 0.18.1 pypi_0 pypi
jinja2 3.1.2 pypi_0 pypi
json5 0.9.10 pypi_0 pypi
jsonschema 4.13.0 pypi_0 pypi
jupyter-client 7.3.4 pypi_0 pypi
jupyter-core 4.11.1 pypi_0 pypi
jupyter-server 1.18.1 pypi_0 pypi
jupyterlab 3.4.5 pypi_0 pypi
jupyterlab-pygments 0.2.2 pypi_0 pypi
jupyterlab-server 2.15.0 pypi_0 pypi
jupyterlab-widgets 3.0.2 pypi_0 pypi
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
lxml 4.9.1 pypi_0 pypi
markupsafe 2.1.1 pypi_0 pypi
matplotlib-inline 0.1.6 pypi_0 pypi
mistune 0.8.4 pypi_0 pypi
nbclassic 0.4.3 pypi_0 pypi
nbclient 0.6.6 pypi_0 pypi
nbconvert 6.5.3 pypi_0 pypi
nbformat 5.4.0 pypi_0 pypi
ncurses 6.3 h5eee18b_3
nest-asyncio 1.5.5 pypi_0 pypi
notebook 6.4.12 pypi_0 pypi
notebook-shim 0.1.0 pypi_0 pypi
openssl 1.1.1q h7f8727e_0
packaging 21.3 pypi_0 pypi
pandocfilters 1.5.0 pypi_0 pypi
parso 0.8.3 pypi_0 pypi
pexpect 4.8.0 pypi_0 pypi
pickleshare 0.7.5 pypi_0 pypi
pip 22.1.2 py39h06a4308_0
prometheus-client 0.14.1 pypi_0 pypi
prompt-toolkit 3.0.30 pypi_0 pypi
psutil 5.9.1 pypi_0 pypi
ptyprocess 0.7.0 pypi_0 pypi
pure-eval 0.2.2 pypi_0 pypi
pycparser 2.21 pypi_0 pypi
pygments 2.13.0 pypi_0 pypi
pyparsing 3.0.9 pypi_0 pypi
pyrsistent 0.18.1 pypi_0 pypi
python 3.9.12 h12debd9_1
python-dateutil 2.8.2 pypi_0 pypi
pytz 2022.2.1 pypi_0 pypi
pyzmq 23.2.1 pypi_0 pypi
readline 8.1.2 h7f8727e_1
requests 2.28.1 pypi_0 pypi
send2trash 1.8.0 pypi_0 pypi
setuptools 61.2.0 py39h06a4308_0
six 1.16.0 pypi_0 pypi
sniffio 1.2.0 pypi_0 pypi
soupsieve 2.3.2.post1 pypi_0 pypi
sqlite 3.39.2 h5082296_0
stack-data 0.4.0 pypi_0 pypi
terminado 0.15.0 pypi_0 pypi
tinycss2 1.1.1 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tornado 6.2 pypi_0 pypi
traitlets 5.3.0 pypi_0 pypi
tzdata 2022a hda174b7_0
urllib3 1.26.11 pypi_0 pypi
wcwidth 0.2.5 pypi_0 pypi
webencodings 0.5.1 pypi_0 pypi
websocket-client 1.3.3 pypi_0 pypi
wheel 0.37.1 pyhd3eb1b0_0
widgetsnbextension 3.6.1 pypi_0 pypi
xz 5.2.5 h7f8727e_1
zipp 3.8.1 pypi_0 pypi
zlib 1.2.12 h7f8727e_2

conda env:
name: ipyw
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=5.1=1_gnu
- ca-certificates=2022.07.19=h06a4308_0
- certifi=2022.6.15=py39h06a4308_0
- ld_impl_linux-64=2.38=h1181459_1
- libffi=3.3=he6710b0_2
- libgcc-ng=11.2.0=h1234567_1
- libgomp=11.2.0=h1234567_1
- libstdcxx-ng=11.2.0=h1234567_1
- ncurses=6.3=h5eee18b_3
- openssl=1.1.1q=h7f8727e_0
- pip=22.1.2=py39h06a4308_0
- python=3.9.12=h12debd9_1
- readline=8.1.2=h7f8727e_1
- setuptools=61.2.0=py39h06a4308_0
- sqlite=3.39.2=h5082296_0
- tk=8.6.12=h1ccaba5_0
- tzdata=2022a=hda174b7_0
- wheel=0.37.1=pyhd3eb1b0_0
- xz=5.2.5=h7f8727e_1
- zlib=1.2.12=h7f8727e_2
- pip:
- anyio==3.6.1
- argon2-cffi==21.3.0
- argon2-cffi-bindings==21.2.0
- asttokens==2.0.8
- attrs==22.1.0
- babel==2.10.3
- backcall==0.2.0
- beautifulsoup4==4.11.1
- bleach==5.0.1
- cffi==1.15.1
- charset-normalizer==2.1.1
- debugpy==1.6.3
- decorator==5.1.1
- defusedxml==0.7.1
- entrypoints==0.4
- executing==0.10.0
- fastjsonschema==2.16.1
- idna==3.3
- importlib-metadata==4.12.0
- ipykernel==6.15.1
- ipython==8.4.0
- ipython-genutils==0.2.0
- ipywidgets==7.7.0
- jedi==0.18.1
- jinja2==3.1.2
- json5==0.9.10
- jsonschema==4.13.0
- jupyter-client==7.3.4
- jupyter-core==4.11.1
- jupyter-server==1.18.1
- jupyterlab==3.4.5
- jupyterlab-pygments==0.2.2
- jupyterlab-server==2.15.0
- jupyterlab-widgets==3.0.2
- lxml==4.9.1
- markupsafe==2.1.1
- matplotlib-inline==0.1.6
- mistune==0.8.4
- nbclassic==0.4.3
- nbclient==0.6.6
- nbconvert==6.5.3
- nbformat==5.4.0
- nest-asyncio==1.5.5
- notebook==6.4.12
- notebook-shim==0.1.0
- packaging==21.3
- pandocfilters==1.5.0
- parso==0.8.3
- pexpect==4.8.0
- pickleshare==0.7.5
- prometheus-client==0.14.1
- prompt-toolkit==3.0.30
- psutil==5.9.1
- ptyprocess==0.7.0
- pure-eval==0.2.2
- pycparser==2.21
- pygments==2.13.0
- pyparsing==3.0.9
- pyrsistent==0.18.1
- python-dateutil==2.8.2
- pytz==2022.2.1
- pyzmq==23.2.1
- requests==2.28.1
- send2trash==1.8.0
- six==1.16.0
- sniffio==1.2.0
- soupsieve==2.3.2.post1
- stack-data==0.4.0
- terminado==0.15.0
- tinycss2==1.1.1
- tornado==6.2
- traitlets==5.3.0
- urllib3==1.26.11
- wcwidth==0.2.5
- webencodings==0.5.1
- websocket-client==1.3.3
- widgetsnbextension==3.6.1
- zipp==3.8.1
prefix: /opt/anaconda/envs/ipyw

Command Line Output
n/a
Browser Output
[Open Browser Console for more detailed log - Double click to close this message]
Failed to load model class 'ButtonModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however,         2.0.0 is
    at f.loadClass (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:74976)
    at f.loadModelClass (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:10721)
    at f._make_model (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:7517)
    at f.new_model (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:5137)
    at f.handle_comm_open (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.467514c324d2bcc23502.js?v=467514c324d2bcc23502:1:3894)
    at _handleCommOpen (http://banach:8890/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.083e6b37f2f7b2f04b5e.js?v=083e6b37f2f7b2f04b5e:1:73392)
    at b._handleCommOpen (http://banach:8890/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:994423)
    at async b._handleMessage (http://banach:8890/static/lab/jlab_core.9193dfb13484acaca919.js?v=9193dfb13484acaca919:2:996413)

If using JupyterLab

  • JupyterLab version: 3.4.5
Installed Labextensions
JupyterLab v3.4.5
/opt/anaconda/envs/ipyw/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v5.0.2 enabled OK (python, jupyterlab_widgets)
@jasongrout
Copy link
Member

We released ipywidgets 7.7.2 and 7.6.5 to fix this issue. It turns out that ipywidgets 7 had not been giving a ceiling for its jupyterlab_widgets dependency, so it was always pulling in the newest version. ipywidgets 7.7.2 and 7.6.5 correct this to pull in jupyterlab_widgets 1.x.

@jasongrout jasongrout added the answered The issue has been answered by a community member. label Aug 20, 2022
@jasongrout
Copy link
Member

jasongrout commented Aug 20, 2022

A few more comments:

  1. If you use pip install 'ipywidgets~=7.7' or pip install 'ipywidgets~=7.7.0', you'll get 7.7.2 rather than 7.7.0
  2. If you use the conda-forge package for ipywidgets 7.7.0, it actually already limited the version of jupyterlab_widgets
  3. Of course, you can also pin your jupyterlab_widgets dependency to really ensure you get what you want, independent of our errors in specifying dependencies in ipywidgets 7.7.0.

Thanks for reporting this. Luckily, someone else reported it yesterday so we could quickly release the 7.7.2 and 7.6.5 bugfixes.

@bernhard-42
Copy link
Author

Thanks @jasongrout this works perfectly. Will change my package dependencies accordingly

@benjaminakcoombs
Copy link

Ipywidgetsproblem

Hi! Have this problem, but upgrading to ipywidgets 7.7.2 hasn't helped. I'm running a jupyter lab installed w/ Anaconda on Ubuntu on Windows. Wondered if there was something I'm missing? Apologies if it's something obvious, and appreciate in advance. Code is example problem, but im seeing it outside just tqdm (e.g,, pandas_profiling.ProfileReport.to_file() also sending same error)

@jasongrout
Copy link
Member

If you have ipywidgets 7.7.x, you need jupyterlab_widgets 1.1.1, so please check to make sure you have that version installed.

@benjaminakcoombs
Copy link

Appreciate the quick response! I believe I have v1.1.1 installed
Ipywidgetsproblem_jw111_adj

@mbarison
Copy link

I have the same issue. Installed

ipywidgets==7.7.2
jupyterlab-widgets==1.1.1

but I still get the same error

@maartenbreddels
Copy link
Member

I guess the environment where jupyter lab runs has a different version installed than the kernel. Could that be right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered The issue has been answered by a community member.
Projects
None yet
Development

No branches or pull requests

5 participants