Jupyter 无法加载笔记本“不匹配的匿名定义()模块”

use*_*275 5 html javascript d3.js jupyter jupyter-notebook

我试图在 jupyter 中使用 D3.js,但我无法让它工作,其中cannot find name d3可能是因为我未能D3正确链接而导致的错误。最后,在尝试了我可以在网上找到的所有内容后,例如:

HTML('<script src="./d3.min.js"></script>')
Run Code Online (Sandbox Code Playgroud)

%%javascript
require.config({
    paths: {
        d3: './d3.min.js'
    }
});
Run Code Online (Sandbox Code Playgroud)

%%HTML
<script src="./d3.min.js" charset="utf-8"></script>
Run Code Online (Sandbox Code Playgroud)

...

我设法让它工作!但是我无法重现漏洞利用!更糟糕的是,在我试图让它再次工作时,我设法打破了我的笔记本,现在每次我重新加载页面时,我都会收到以下消息:

Notebook failed to load
The error was:
Error: Mismatched anonymous define() module: function (t){"use strict";function n(t){return function(n,e){return ms(t(n),e)}}function e(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Rs?i*=10:o>=Us?i*=5:o>=Ds&&(i*=2),n<t?-i:i}function r(t){return t.length}function i(){}function o(t,n){var e=new i;if(t instanceof i)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,o=-1,u=t ...
Run Code Online (Sandbox Code Playgroud)

怎么了 ?它甚至不等我运行任何单元格崩溃?是否有可能当我D3使用 HTML导入库时,我已经注入了一些导入并破坏了一些依赖项?我怎样才能解决这个问题 ?