我已經嘗試了一個簡單的內聯教程,並使用cookiecutter模板來製作Jupyter小部件,但不加載小部件。無法加載Jupyter筆記本中的自定義小部件
當我嘗試這個tutorial即使是hello世界小部件,我也只是打印出「Jupyter Widget」,並在控制檯中獲得「404 GET /nbextensions/widgets/notebook/js/extension.js」。
當我嘗試內嵌例子,我在控制檯中「404 GET /static/@jupyter-widgets/base.js」爲直列例子的代碼此錯誤只是
import ipywidgets as widgets
from traitlets import Unicode, validate
class HelloWidget(widgets.DOMWidget):
_view_name = Unicode('HelloView').tag(sync=True)
_view_module = Unicode('hello').tag(sync=True)
_view_module_version = Unicode('0.1.0').tag(sync=True)
%%javascript
require.undef('hello');
define('hello', ["@jupyter-widgets/base"], function(widgets) {
var HelloView = widgets.DOMWidgetView.extend({
// Render the view.
render: function() {
this.el.textContent = 'Hello World!';
},
});
return {
HelloView: HelloView
};
});
這是在conda虛擬環境中,Jupyter 4.2.1和筆記本4.3.1
在此先感謝您的幫助。