socket.gaierror: [Errno -5] No address associated with hostname
問題出在遠端連線回主機時,hostname不是localhost,而預設的jupyterlab沒有開啟遠端功能。
solve: (jupyterlab 0.33.12) 把下面的命令貼在linux的terminal然後執行。
echo yes | jupyter notebook --generate-config
defaultPath="${HOME}/.jupyter/jupyter_notebook_config.py"
sed -i -e '82c c.NotebookApp.allow_remote_access = True' "$defaultPath"
sed -i -e '204c c.NotebookApp.ip = "*"' "$defaultPath"
sed -i -e '267c c.NotebookApp.open_browser = False' "$defaultPath"
sed -i -e '287c c.NotebookApp.port = 8888' "$defaultPath"
接下來可能要設置密碼
jupyter notebook password
設置好以後正常啟動即可
jupyter lab