Unable to use weas-widget in Vscode
When I tried to use weas-widget in VScode, it tells me that "Click to show javascript error".
And the error was
at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2420023)
at WidgetManager.loadClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2803837)
at WidgetManager.loadModelClass (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2416808)
at WidgetManager._make_model (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2414769)
at WidgetManager.new_model (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2412488)
at WidgetManager.handle_comm_open (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2411259)
at https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-renderers-1.1.0/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:2802850
at t._handleCommOpen (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-win32-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:119358)
at async t._handleMessage (https://file+.vscode-resource.vscode-cdn.net/c%3A/Users/74240/.vscode/extensions/ms-toolsai.jupyter-2024.11.0-win32-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:121233)
Thanks for reporting the issue! Could you try to upgrade the jupyterlab and other related package.
pip install jupyterlab --upgrade
upgrade other package may also help
pip install anywidget --upgrade
pip install widgetsnbextension --upgrade
I upgrade the packages above, but It doesn't work.
Does it work in a normal Jupyter Lab (notebook)?
Yes. It works in jupyter lab.
Please also try
pip install ipywidgets --upgrade
If it still doesn't work, please share your package lists.
pip list > packages.txt
I can compare it with mine.
My ipywidgets's version is 8.1.5, and "packages.txt" is below. packages.txt
I tried in another computer(PC2, the computer with trouble called PC1), and it do works in vscode! ipywidgets's version in PC2 is 8.1.5, too. So it must be someone else make it not work in PC1. packages_PC2.txt is below.
The second file seems to be a binary, and can not see the details.
Yes. It works in jupyter lab.
In this case, the environment should be fine. You could try to upgrade the jupyter extension of the Vscode, or Vscode itself.