You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Voila转换含IPython Widgets的Jupyter Notebook时遇JS版本错误

Voila显示IPython Widgets时出现版本不兼容的JavaScript错误

我正在尝试用Voila将Jupyter Notebook转换为交互式网页(最终目标是部署到GitHub并通过Binder访问)。当不显示IPython Widgets时,Voila运行完全正常,但一旦尝试展示组件,就会触发以下JavaScript错误:

Failed to load model class 'VBoxModel' from module '@jupyter-widgets/controls'
Error: Module @jupyter-widgets/controls, version ^1.5.0 is not registered, however, 2.0.0 is
    at tn.loadClass (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:117212)
    at tn.loadClass (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:472:57590)
    at tn.loadModelClass (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:114982)
    at tn._make_model (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:111789)
    at tn.new_model (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:109386)
    at http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:110660)
    at Array.map ()
    at tn._loadFromKernel (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:458:110550)
    at async tn.build_widgets (http://localhost:8812/voila/templates/lab/static/voila.js?v=8db1cadbfba43a6dfc2d64128318e696bcb26b1783db1b991faf7404d438cd53200b6c434c4897064c090b68aa1151cd96c6dab50c3e138553365e6b30889172:472:56804)
    at async init (http://localhost:8812/voila/templates/lab/static/main.js?v=07cc494763c3dcb3b604da7aa291ed361b8b163d9cb33c4bc3a66304c18e1dc5bfcf8c6101b6b6426ab36762a01a8568e9f3bf0c7ba6588cd61eab538b95e34a:63:13)

我已经测试过Voila的官方示例代码,只要显示Widgets就会出现相同错误,说明问题不在代码本身。推测是包版本不兼容导致的,试过新建Anaconda环境、更新所有相关包,但问题仍未解决。


内容的提问来源于stack exchange,提问作者Carter Allen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 02:25:47