美文网首页
局域网访问Jupyter notebook

局域网访问Jupyter notebook

作者: 苦海飘摇 | 来源:发表于2020-10-12 16:55 被阅读0次

配置jupyter notebook

# 查看用户目录 ~/.jupyter 路径下是否存jupyter_notebook_config.py 文件。若不存在,产生此文件。
$ jupyter notebook --generate-config
$ vim ~/.jupyter/jupyter_notebook_config.py

# 找到 c.ConnectionFileMixin.ip 并修改如下:
c.ConnectionFileMixin.ip = '0.0.0.0'

# 找到 c.NotebookApp.ip 并修改如下:
c.NotebookApp.ip = '0.0.0.0'

jupyter notebook
c.NotebookApp.ip = '*'  # 允许访问此服务器的 IP,星号表示任意 IP
c.NotebookApp.password = u'sha1:xxx:xxx' # 之前生成的密码 hash 字串
c.NotebookApp.open_browser = False # 运行时不打开本机浏览器
c.NotebookApp.port = 8888 # 使用的端口
c.NotebookApp.enable_mathjax = True # 启用 MathJax

执行上述命令,会在命令行看到http://0.0.0:8888/?token=xxxxxxx的提示
打开浏览器上粘贴这个地址后,把0.0.0.0替换成服务器的IP地址即可。

相关文章

网友评论

      本文标题:局域网访问Jupyter notebook

      本文链接:https://www.haomeiwen.com/subject/oshppktx.html