2017-02-09 383 views
0

我試圖在Ubuntu 14.04上安裝並運行Jupyter。安裝似乎確定,但是當我打開瀏覽器,然後嘗試打開一個Python筆記本電腦,瀏覽器會彈出一個連接失敗標題的窗口:修復Jupyter中的位置/ nbextensions資源

到筆記本電腦服務器的連接不能建立。筆記本電腦將繼續嘗試重新連接。檢查您的網絡連接或筆記本服務器配置。

的問題是在服務器端:Jupyter不定位nbextensions ressources成功,通過下面的警告線所示:

404 GET /nbextensions/widgets/notebook/js/extension.js 

這個錯誤已被提出過,但沒有建議解決方案爲我解決。 我在Ubuntu 16.04上遇到同樣的問題。

這裏是我的配置:

~$ python -V 
Python 3.5.3 
~$ pip3 -V 
pip 9.0.1 from /opt/python3.5/lib/python3.5/site-packages (python 3.5) 
~$ jupyter --version 
4.2.1 
~$ jupyter notebook --version 
4.3.2 

這裏是服務器上的Jupyter輸出:

~$ jupyter notebook --ip=192.168.2.15 --port=8080 --no-browser 
[I 15:46:03.317 NotebookApp] Serving notebooks from local directory: /home/foo 
[I 15:46:03.318 NotebookApp] 0 active kernels 
[I 15:46:03.318 NotebookApp] The Jupyter Notebook is running at: http://192.168.2.15:8080/?token=9df9879c1ce98a4b9bff1c483110a00d08fa1645ec09bdc8 
[I 15:46:03.318 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). 
[C 15:46:03.318 NotebookApp] 
    Copy/paste this URL into your browser when you connect for the first time, 
    to login with a token: 
     http://192.168.2.15:8080/?token=9df9879c1ce98a4b9bff1c483110a00d08fa1645ec09bdc8 
[I 15:46:22.058 NotebookApp] Creating new notebook in 
[W 15:46:22.645 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20170209154602 (161.106.4.5) 10.77ms referer=http://blabla:8080/notebooks/Untitled1.ipynb?kernel_name=python3 
[I 15:46:22.749 NotebookApp] Kernel started: c35da40d-1ba0-4680-80f7-b0ab28c3f75c 
+0

具有瀏覽器和服務器之間的代理防火牆,當我有問題。我發現它在沒有代理防火牆的情況下工作正常(代理防火牆可能略微修改了HTTP負載)。因此,我安裝了cerfiticate,並在--port = 443上使用--certfile和--keyfile選項啓動了jupyter notebook命令,從而解決了最初的問題。 –

回答

0

需要加載nbextensions

安裝pip3 install ipywidgets

更改文件:~/.jupyter/nbconfig/notebook.json

{ 
    "load_extensions": { 
    "jupyter-js-widgets/extension": true 
    } 
} 

其他包:

pip3 install jupyter-js-widgets-nbextension 
pip3 install nbextensions 

重新運行jupyter筆記本