美文网首页
启动 Jupyter Notebook 遇到 socket.ga

启动 Jupyter Notebook 遇到 socket.ga

作者: 悬崖边上的日与夜 | 来源:发表于2019-07-10 22:31 被阅读0次

    默认配置的情况下,无法启动 Jupyter notebook,报错如下:

    
    socket.gaierror: [Errno -2] Name or service not known
    
    

    官方文档中的提到只需要更改 ~/.jupyter/jupyter_notebook_config.py 文件中的 c.NotebookApp.ip 即可实现外部访问:

    
    # Set ip to '*' to bind on all interfaces (ips) for the public server
    
    c.NotebookApp.ip = '*'
    
    

    但在较新的版本的 Jupyter(大概5.6.0以上)中,如果不做其他改动,便会报错。解决办法有两种:

    1. c.NotebookApp.ip 改为 0.0.0.0

    2. 打开远程访问权限,将 c.NotebookApp.allow_remote_access 改为 True

    相关链接:

    相关文章

      网友评论

          本文标题:启动 Jupyter Notebook 遇到 socket.ga

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