IPython/Jupyter Installing Extensions

耗尽温柔 提交于 2019-12-01 11:05:05

There's been a little change to the syntax. Nowadays, $ might not be defined by the time your custom.js loads, so instead of something like

$([IPython.events]).on("app_initialized.NotebookApp", function () {
    IPython.load_extensions("whatever");
});

you should do something like

require(['base/js/namespace', 'base/js/events'], function(IPython, events) {
    events.on('app_initialized.NotebookApp', function(){
        IPython.load_extensions("whatever");
    })
});

with the appropriate changes to braces and parentheses. For me, the former will work more often than not, but certainly not always; it fails maybe ~1/3 of the time.

If that doesn't do it for you, open up Developer Tools (or whatever is relevant for your browser) and look at the javascript console for errors. That'll help figure out what's going wrong.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!