【问题标题】:Exposing python jupyter on LAN在 LAN 上暴露 python jupyter
【发布时间】:2016-08-25 22:54:27
【问题描述】:

我已经在本地网络 LAN 上安装了 jupyter,但我无法从 LAN 上的另一台机器访问 http://<IP>:8888。我已经用 iptables 打开了端口 8888 和端口范围 49152 到 65535(这个范围在 http://jupyter-notebook.readthedocs.io/en/latest/public_server.html 中指定)

本指南http://jupyter-notebook.readthedocs.io/en/latest/public_server.html 描述了公开暴露笔记本,但我只是尝试通过 LAN 共享。

我错过了一步吗?

【问题讨论】:

    标签: python linux python-3.x ubuntu-14.04 jupyter


    【解决方案1】:

    试试jupyter notebook --ip <your_LAN_ip> --port 8888 然后从另一台计算机访问http://your_LAN_ip:8888

    建议您在访问笔记本服务器时使用密码。要设置密码,只需运行jupyter notebook password。为了使其更加安全,您可以通过将参数--certfile--keyfile 传递给jupyter notebook 来为您的服务器使用SSL。您可以阅读有关设置的更多信息here

    【讨论】:

    • 非常感谢,这行得通。将尽快接受,6 分钟。
    【解决方案2】:

    在 macOS 中,以下对我有用

    0。使用

    生成配置文件

    jupyter notebook --generate-config

    1。在配置文件中设置并添加

    c.NotebookApp.ip = '0.0.0.0' # listen on all IPs
    c.NotebookApp.token = ''     # disable authentication
    c.NotebookApp.allow_origin = '*' # allow access from anywhere
    c.NotebookApp.disable_check_xsrf = True # allow cross-site requests
    

    2。运行:

    jupyter notebook --ip <your_LAN_ip> --port 8888
    

    【讨论】:

    • 端口号也可以使用以下命令添加到配置中:c.NotebookApp.port = 8888
    【解决方案3】:

    也可以在配置文件的c.NotebookApp.ip = '&lt;your_ip_or_hostname&gt;'c.NotebookApp.port = 8888参数中添加IP/主机。

    如果您还没有 jupyter 配置文件,请运行 jupyter notebook --generate-config

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-19
      • 1970-01-01
      • 2018-02-25
      • 2020-01-15
      • 1970-01-01
      相关资源
      最近更新 更多