jupyter-notebook - Jupyter Nbextensions 在我的一些笔记本中有效,但在其他笔记本中无效

标签 jupyter-notebook jupyter

我越来越喜欢 Jupyter Nbextensions。它们似乎适用于我创建的任何新笔记本,但它们从未适用于我的一些旧笔记本。回顾 Jupyter 启动时的喷涌,我看不到任何可能暗示原因的内容,但也许其他人可以帮助我找到问题的根源。这是当我打开未出现 nbextensions 的笔记本时出现的溢出:

G:\DATA\EDUCATION\Computer Science\Machine Learning\Projects - Machine Learning\iPython (Machine Learning Tutorial)>jupyter notebook
[I 13:39:52.478 NotebookApp] [nb_conda_kernels] enabled, 6 kernels found
[I 13:39:53.312 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.2.5
[I 13:39:53.486 NotebookApp] [nb_anacondacloud] enabled
[I 13:39:53.534 NotebookApp] [nb_conda] enabled
[I 13:39:54.180 NotebookApp] \u2713 nbpresent HTML export ENABLED
[W 13:39:54.180 NotebookApp] \u2717 nbpresent PDF export DISABLED: No module named 'nbbrowserpdf'
[I 13:39:54.396 NotebookApp] Serving notebooks from local directory: G:\DATA\EDUCATION\Computer Science\Machine Learning\Projects - Machine Learning\iPython (Machine Learning Tutorial)
[I 13:39:54.396 NotebookApp] 0 active kernels
[I 13:39:54.396 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=a32e730ddd80639a9d1ba52af82606856b2f028a0f2ea12a
[I 13:39:54.396 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:39:54.411 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=a32e730ddd80639a9d1ba52af82606856b2f028a0f2ea12a
[I 13:39:54.662 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 13:40:06.038 NotebookApp] Notebook NumPy (ver. 2.0 2017-09-26).ipynb is not trusted
[I 13:40:47.014 NotebookApp] Kernel started: eb66a861-e1e0-426e-81ba-eaacdfd4c47e
[W 13:40:47.158 NotebookApp] 404 GET /notebooks/images/Frobenius%20Norm.png (::1): No such file or directory: images/Frobenius Norm.png
[W 13:40:47.174 NotebookApp] 404 GET /notebooks/images/Frobenius%20Norm.png (::1) 27.02ms referer=http://localhost:8888/notebooks/NumPy%20(ver.%202.0%202017-09-26).ipynb
[W 13:40:52.083 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20170926133952 (::1) 2.00ms referer=http://localhost:8888/notebooks/NumPy%20(ver.%202.0%202017-09-26).ipynb
[I 13:40:53.787 NotebookApp] Adapting to protocol v5.1 for kernel eb66a861-e1e0-426e-81ba-eaacdfd4c47e
[I 13:41:50.017 NotebookApp] Kernel shutdown: eb66a861-e1e0-426e-81ba-eaacdfd4c47e
[I 13:41:51.648 NotebookApp] Kernel started: f32da744-5615-4579-b636-2183b4712eb8
[I 13:42:47.175 NotebookApp] Saving file at /NumPy (ver. 2.0 2017-09-26).ipynb
[W 13:42:47.189 NotebookApp] Saving untrusted notebook NumPy (ver. 2.0 2017-09-26).ipynb
[I 13:45:04.715 NotebookApp] Saving file at /NumPy (ver. 2.0 2017-09-26).ipynb
[W 13:45:48.451 NotebookApp] 404 GET /notebooks/images/Frobenius%20Norm.png (::1): No such file or directory: images/Frobenius Norm.png
[W 13:45:48.453 NotebookApp] 404 GET /notebooks/images/Frobenius%20Norm.png (::1) 3.00ms referer=http://localhost:8888/notebooks/NumPy%20(ver.%202.0%202017-09-26).ipynb
[W 13:45:50.924 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20170926133952 (::1) 2.00ms referer=http://localhost:8888/notebooks/NumPy%20(ver.%202.0%202017-09-26).ipynb

这是当我打开 nbextensions 正在工作的笔记本时看到的额外几行内容:

[W 13:57:27.521 NotebookApp] Notebook NLP/LSTM/Sentiment Analysis with LSTM/Experiments with Sentiment Analysis.ipynb is not trusted
[I 13:57:39.619 NotebookApp] Kernel started: 73225ddd-b5cd-46bb-80ec-b9841765357b

最佳答案

正如我所怀疑的,the Github article我在上面的评论中引用了答案。我的旧笔记本中有很多 LaTex markdown,MathJax 在加载时与 Nbextensions 发生冲突。显然,由于所有 Latex Markdown 导致加载时间延长,Nbextensions 超时了。本文指出的唯一解决方案是增加 ./jupyter/custom/custom.js 中的超时间隔。就我而言,我必须将其增加 4 倍到 120 秒:

window.requirejs.config({
    waitseconds: 120,  // default is 30s
});

关于jupyter-notebook - Jupyter Nbextensions 在我的一些笔记本中有效,但在其他笔记本中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46433972/

相关文章:

python - 虚拟环境的特定 jupyter notebook 配置文件

python - 是否可以在不删除前一个字符的情况下在彼此之上打印字符以同时具有上标和下标?

python - 通过 jupyter 笔记本运行远程内核

Python qtConsole 和 Spyder : Problems with loading modules

python - jupyter笔记本/实验室终端python版本

terminal - 从终端启动 jupyter notebook 也会启动信号桌面信使

python-3.x - 如果数据框中的值属于某个范围,有没有办法对数据框中的值进行着色(Python-Pandas)

python - 是否可以在 nbviewer 中使用 jupyter_contrib_nbextensions?

python - 改进 PySpark DataFrame.show 输出以适应 Jupyter 笔记本

python - 如何部署python脚本?