2017-02-09 385 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笔记本