crahan / ipyfilechooser

Python file chooser widget for use in Jupyter/IPython in conjunction with ipywidgets
MIT License
103 stars 19 forks source link

ipyfilechooser appears broken with ipywidgets>=8.0.0 #72

Closed al165 closed 1 year ago

al165 commented 2 years ago

Hi,

After upgrading ipywidgets to the latest version (==8.0.1), my older notebooks do not display the file chooser widget with the code below:

from IPython.display import display
from ipyfilechooser import FileChooser

fc = FileChooser()
display(fc)

There is nothing displayed under the cell after running it. However, in the browser console (Firefox) I see a bunch of error messages thrown by extensions.js and kernel.js that are the following repeated a bunch of times:

> Error: Could not create a model. 
    ....

> Couldn't process kernel message Error: Cannot find model module @jupyter-widgets/controls@2.0.0, TextStyleModel
    ....

> Couldn't process kernel message Error: Cannot find model module @jupyter-widgets/controls@2.0.0, HTMLStyleModel
    ....

I can render other widgets (such as sliders) perfectly fine, it's just ipyfilechooser that seems to be broken.

The workaround for now is to use pip to downgrade ipywidgets to back to version 7.7.1 fixes the issue for now. I am using python version 3.9.10.

crahan commented 2 years ago

Thanks for the heads up. I'll try and fix asap!

crahan commented 1 year ago

My apologies for the delay. I ran a test on a fresh Python 3.10.6 environment with the below package versions (including ipywidgets versionb 8.0.2) and the sample you provided seemed to work. The button appeared and clicking it displayed the file dialog.

Can you please try upgrading to ipywidgets 8.0.2 to see if that helps fix the issue?

Screen Shot 2022-09-20 at 20 04 03

Package              Version     Editable project location
-------------------- ----------- ------------------------------------------
anyio                3.6.1
appnope              0.1.3
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            1.0.0
fastjsonschema       2.16.1
idna                 3.3
ipyfilechooser       0.6.0
ipykernel            6.15.2
ipython              8.4.0
ipython-genutils     0.2.0
ipywidgets           8.0.2
jedi                 0.18.1
Jinja2               3.1.2
json5                0.9.10
jsonschema           4.15.0
jupyter_client       7.3.5
jupyter-core         4.11.1
jupyter-server       1.18.1
jupyterlab           3.4.5
jupyterlab-pygments  0.2.2
jupyterlab_server    2.15.1
jupyterlab-widgets   3.0.3
lxml                 4.9.1
MarkupSafe           2.1.1
matplotlib-inline    0.1.6
mistune              2.0.4
nbclassic            0.4.3
nbclient             0.6.7
nbconvert            7.0.0
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.2.2
prometheus-client    0.14.1
prompt-toolkit       3.0.31
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           63.2.0
six                  1.16.0
sniffio              1.3.0
soupsieve            2.3.2.post1
stack-data           0.5.0
terminado            0.15.0
tinycss2             1.1.1
tornado              6.2
traitlets            5.3.0
urllib3              1.26.12
wcwidth              0.2.5
webencodings         0.5.1
websocket-client     1.4.0
widgetsnbextension   4.0.3
al165 commented 1 year ago

Hey, sorry for the delay - yes it seems to be working again in my environment with ipywidgets==8.0.2. Not sure in the end which package was out of date that was causing the issue (I was also having problems with tqdm.notebook showing properly too, but this also works now), so then it is resolved.

Thanks for your time!