问题
问题描述
jupyter notebook
运行之后显示
[W 21:11:31.141 NotebookApp] Cannot bind to localhost, using 127.0.0.1 as default ip
[Errno 8] nodename nor servname provided, or not known
[I 21:11:31.150 NotebookApp] Serving notebooks from local directory: /Users/hesj/Downloads/lecture08_codes
[I 21:11:31.150 NotebookApp] 0 active kernels
[I 21:11:31.150 NotebookApp] The Jupyter Notebook is running at: http://127.0.0.1:8888/
[I 21:11:31.150 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
0:42: execution error: “"http://127.0.0.1:8888/tree"”不理解“open location”信息。 (-1708)
浏览器没有自动打开
环境
- macOS 10.12.5
- python 3.4
原因
这个问题由于最新的Mac OSX 10.12.5升级。
解决方案
- 生成配置文件
jupyter notebook --generate-config #记录配置文件地址
- 在终端中输入ipython3打开Python,生成密码的sha1密钥
from notebook.auth import passwd passwd()
在文本框中输入并确认一次密码后记录sha1秘钥值,如'sha1:XXXXXXX'
退出python
- vim打开配置文件jupyter_notebook_config.py,在最后加入
# 制定浏览器 c.NotebookApp.browser = u'chrome' c.NotebookApp.password = u'sha1:XXXXXXX'
- 重启jupyter,重新打开网页即可