Aak*_*rsh 2 javascript python ipython requirejs jupyter-notebook
我正在尝试在 ipython notebook 中加载 d3 和 dimple.js 但它抛出错误。我也试过需要但无法加载请给我一些解决方法
在笔记本中运行它以找出您的 jupyter 目录:
from jupyter_core.paths import jupyter_config_dir
jupyter_dir = jupyter_config_dir()
jupyter_dir
Run Code Online (Sandbox Code Playgroud)在从上面找到的 jupyter 目录下创建名为“custom”的文件夹/custom
在 /custom/custom.js 下创建 custom.js 文件并添加以下内容
requirejs.config({
paths: {
d3: 'd3.min',
}
});
Run Code Online (Sandbox Code Playgroud)打开为您的个人资料创建的 jupyter_notebook_config.py。如果未创建,请使用以下命令从命令行/终端创建一个
jupyter notebook --generate-config
Run Code Online (Sandbox Code Playgroud)在 jupyter_notebook_config.py(从 generate-config 命令创建)中修改 js 文件夹的静态路径,如下所示
c.NotebookApp.extra_static_paths = ["C:\your-js-folder"]
Run Code Online (Sandbox Code Playgroud)将外部 js 文件放在 C:\your-js-folder 下,然后停止并启动 jupyter notebook
| 归档时间: |
|
| 查看次数: |
2470 次 |
| 最近记录: |