Jupyter Notebook显示错误

时间:2018-07-26 07:12:43

标签: python jupyter-notebook

我已经安装了jupyter,但是每当我尝试打开笔记本时,它都会显示以下错误:

**/home/hduser/.local/lib/python3.5/site-packages/IPython/paths.py:61: UserWarning: IPython dir '/home/hduser/.ipython' is not a writable location, using a temp directory.
  " using a temp directory.".format(ipdir))
[I 12:31:32.732 NotebookApp] Serving notebooks from local directory: /home/protyay
[I 12:31:32.733 NotebookApp] The Jupyter Notebook is running at:
[I 12:31:32.733 NotebookApp] http://localhost:8888/?token=b3b2ff7955e5825655d1dc1c4539f193a76c8ab89ffbf008
[I 12:31:32.733 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:31:32.733 NotebookApp] 

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?

token=b3b2ff7955e5825655d1dc1c4539f193a76c8ab89ffbf008
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :0**

如果我打开url,则会显示笔记本,但这无法使我创建或打开新的python3笔记本。

1 个答案:

答案 0 :(得分:0)

这是与GUI相关的问题。为了解决这个问题,请在.bashrc中添加以下配置:

导出DISPLAY =:0

在Ubuntu 16.04上的侏儒,正确的值为DISPLAY =:1(不是DISPLAY =:0)

要永久解决此问题,您可以使用gedit或sudo visudo在/ etc / sudoers的末尾添加以下行:

默认为env_keep + =“ DISPLAY”

详细解决方案: https://askubuntu.com/questions/871092/failed-to-connect-to-mir-failed-to-connect-to-server-socket-no-such-file-or-di