jupyter抛出错误:socket.gaierror:[Errno -2]名称或服务未知
Posted
技术标签:
【中文标题】jupyter抛出错误:socket.gaierror:[Errno -2]名称或服务未知【英文标题】:jupyter throwing error: socket.gaierror: [Errno -2] Name or service not known 【发布时间】:2018-10-08 16:08:36 【问题描述】:我在 AWS EMR 上运行一个 pyspark 集群,并将 Jupyter 用于 pyspark 驱动程序。最近,脚本失败了。 Jupiter 无法启动服务器。我使用conda install jupyter
安装并从sudo initctl start jupyter
开始。集群运行良好。这是服务器的配置值。
# jupyter configs
mkdir -p ~/.jupyter
touch ls ~/.jupyter/jupyter_notebook_config.py
HASHED_PASSWORD=$(python -c "from notebook.auth import passwd;
print(passwd('$JUPYTER_PASSWORD'))")
echo "c.NotebookApp.password = u'$HASHED_PASSWORD'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.notebook_dir = '/mnt/$BUCKET/$FOLDER'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.ContentsManager.checkpoints_kwargs = 'root_dir': '.checkpoints'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 8080" >> ~/.jupyter/jupyter_notebook_config.py
【问题讨论】:
【参考方案1】:我发现在更新到 jupyter 5.7 之后。我不得不修改配置参数。改变
echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py
到
echo "c.NotebookApp.ip = '0.0.0.0'" >> ~/.jupyter/jupyter_notebook_config.py
【讨论】:
它帮助了我,感谢像这样启动时我遇到了同样的错误:jupyter-notebook --open_browser=False --ip=* 我将其更改为这一行,一切都开始正常工作:jupyter-笔记本 --open_browser=False --ip="0.0.0.0" @VladimirGorovoy 很高兴它有帮助! FWIW 这是更改的相关问题:github.com/jupyter/notebook/pull/3714以上是关于jupyter抛出错误:socket.gaierror:[Errno -2]名称或服务未知的主要内容,如果未能解决你的问题,请参考以下文章
Jupyter 安装返回“python setup.py egg_info”失败,错误代码为 1
为啥 toPandas() 会抛出错误,而 .show() 工作得很好?
带有 conda 集成的 pySpark 抛出错误 pyspark 无法识别