jupyter笔记本无法在Mac上运行

时间:2017-02-01 03:46:09

标签: python macos python-2.7 jupyter

pip install jupyter

$ jupyter notebook

我无法正确运行jupyter-notebook。我得到的错误是:

Traceback (most recent call last): File "/usr/local/bin/jupyter-notebook", line 11, in <module> sys.exit(main()) File "/Library/Python/2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance app.initialize(argv) File "<decorator-gen-7>", line 2, in initialize File "/Library/Python/2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, *args, **kwargs) File "/Library/Python/2.7/site-packages/notebook/notebookapp.py", line 1071, in initialize self.init_webapp() File "/Library/Python/2.7/site-packages/notebook/notebookapp.py", line 919, in init_webapp self.http_server.listen(port, self.ip) File "/Library/Python/2.7/site-packages/tornado/tcpserver.py", line 126, in listen sockets = bind_sockets(port, address=address) File "/Library/Python/2.7/site-packages/tornado/netutil.py", line 153, in bind_sockets 0, flags)): socket.gaierror: [Errno 4] Non-recoverable failure in name resolution

1 个答案:

答案 0 :(得分:1)

检查/ etc / hosts后,我删除了错误的localhost记录,但不知道是谁添加它。

之前:

127.0.0.1    localhost
255.255.255.255    broadcasthost
::1             localhost 
fe80::10    localhost

后:

127.0.0.1    localhost
255.255.255.255    broadcasthost
::1             localhost 

现在jupyter笔记本正在运行。