无法在python linux服务器上启动笔记本

时间:2018-07-23 19:19:41

标签: python jupyter-notebook

我已经在Linux上安装了anaconda。我正在尝试按以下方式启动jupyter笔记本:

./jupyter notebook --no-browser --port=8889

看起来像启动,控制台上没有错误。但是当我尝试访问url

http://<server ip>:8889

我收到页面不可用错误。有什么想法我在这里想念的吗?

这是启动jupyter笔记本后的输出:

 bin]$ ./jupyter notebook --no-browser --port=8889
[I 15:43:02.760 NotebookApp] JupyterLab beta preview extension loaded from /usr/local/clo/ven/python-2.7.12/anaconda2/lib/python2.7/site-packages/jupyterlab
[I 15:43:02.760 NotebookApp] JupyterLab application directory is /usr/local/clo/ven/python-2.7.12/anaconda2/share/jupyter/lab
[I 15:43:02.765 NotebookApp] Serving notebooks from local directory: /usr/local/clo/ven/python-2.7.12/anaconda2/bin
[I 15:43:02.765 NotebookApp] 0 active kernels
[I 15:43:02.766 NotebookApp] The Jupyter Notebook is running at:
[I 15:43:02.766 NotebookApp] http://localhost:8889/?token=e2d0598937406066fc34f23f5f2187f2d6393976d84b5a2e
[I 15:43:02.766 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:43:02.766 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8889/?token=e2d0598937406066fc34f23f5f2187f2d6393976d84b5a2e&token=e2d0598937406066fc34f23f5f2187f2d6393976d84b5a2e

1 个答案:

答案 0 :(得分:0)

默认情况下,笔记本服务器在本地运行于127.0.0.1:8888,并且只能从本地主机访问。您可以使用http://127.0.0.1:8888从浏览器访问笔记本服务器;这意味着您无法从外部环境(服务器以外的任何计算机)访问它

按照official docs

中的说明进行更改

在上述说明无效的情况下,您可以转发您的IP地址,以便以某种方式将其视为服务器的一部分:

ssh -N -f -L localhost:8888:localhost:8889 remote_user@remote_host