简体   繁体   English

Jupyter Notebook显示错误

[英]Jupyter Notebook showing error

I have installed jupyter but whenever i'm trying to open the notebook it's showing the below error: 我已经安装了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**

If i open the url, then the notebook is getting displayed but it's not enabling me to create or open a new python3 notebook. 如果我打开url,则会显示笔记本,但这无法使我创建或打开新的python3笔记本。

This is GUI related issue. 这是与GUI相关的问题。 To solve this please add the following configuration in your .bashrc : 为了解决这个问题,请在.bashrc中添加以下配置:

export DISPLAY=:0 出口DISPLAY =:0

Gnome on Ubuntu 16.04, the correct value is DISPLAY=:1 (not DISPLAY=:0) 在Ubuntu 16.04上的Gnome,正确的值为DISPLAY =:1(不是DISPLAY =:0)

To fix this permanently you can add the following line at the end of /etc/sudoers using gedit or using sudo visudo : 要永久解决此问题,您可以使用gedit或sudo visudo在/ etc / sudoers的末尾添加以下行:

Defaults env_keep+="DISPLAY" 默认值env_keep + =“ DISPLAY”

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM