2017-09-26 139 views
0

我越來越喜歡Jupyter Nbextensions。他們似乎在我創建的任何新筆記本中工作,但他們從未在我的一些舊筆記本中工作。回顧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 
+0

剛剛發現一個Github上的文章,其內容讓我懷疑,也許問題與我的舊的筆記本電腦是不是他們的年齡或版本,但他們的*大小*。他們很大: https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/822 –

回答

0

正如我所懷疑的,我在上面的評論中引用了the Github article提供了答案。我的舊筆記本中有很多LaTex降價,MathJax在加載時與Nbextensions交戰。顯然,由於所有Latex降價導致的延長加載時間,Nbextensions已經超時。本文指出的唯一解決方案是在./jupyter/custom/custom.js中增加超時間隔。就我而言,我不得不通過的4倍,以增加它到120秒:

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

後續評論:我上面提出的解決方案有助於解決問題,但並不能完全解決問題。隨着我的筆記本電腦規模不斷增長,無論我在window.requirejs.config中使waitseconds常量如何大,它們總是達到nbextensions無法加載的程度。 [嘆] –

相關問題