IPython/Jupyter Installing Extensions

前端 未结 1 1678
面向向阳花
面向向阳花 2021-01-15 06:05

I\'m having troubles installing extensions in IPython. The problem is that i can\'t get the extensions load automatically, i have followed the instructions in the github pag

相关标签:
1条回答
  • 2021-01-15 06:40

    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.

    0 讨论(0)
提交回复
热议问题