Jupyter笔记本显示

2024-04-24 14:30:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了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笔记本。在


Tags: totokenhomeserverislocalconnectipython
1条回答
网友
1楼 · 发布于 2024-04-24 14:30:50

这个问题与GUI有关。要解决此问题,请在.bashrc中添加以下配置:

导出显示=:0

在ubuntu16.04上,正确的值是DISPLAY=:1(而不是DISPLAY=:0)

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

默认环境keep+=“显示”

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

相关问题 更多 >