C ++ jupyter内核死亡

时间:2018-01-13 21:10:47

标签: python c++ jupyter-notebook cling

当我使用cling启动c ++ 14 jupyter内核时,我有以下回溯。我从

下载了cling_2018-01-11_mac1012.tar.bz2
https://root.cern.ch/download/cling/

然后将bin添加到路径中。为此,我打开了一个终端并输入了

sudo nano /etc/paths

弹出我的密码,然后在文件的底部,从下载中输入二进制文件夹的路径(我从命令i获取文件获取信息),退出并保存缓冲区。使用

进行测试
echo $PATH 

将其添加到路径后,打开一个新终端。 cd进入下载,然后将内核安装在:

/share/cling/Jupyter/kernel

pip install .

jupyter kernelspec install cling-cpp14
然后我从桌面打开了一个笔记本,打开了一个c ++ 14笔记本,但不幸的是内核死了。这是追溯。任何帮助赞赏。

Last login: Sat Jan 13 20:50:16 on ttys000
Air-2:~ $ jupyter notebook
[I 20:52:08.968 NotebookApp] Serving notebooks from local directory: /Users/
[I 20:52:08.968 NotebookApp] 0 active kernels 
[I 20:52:08.968 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=d80248d47c35d5f960dc7206a612940826e425ca9f065740
[I 20:52:08.968 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 20:52:08.971 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=d80248d47c35d5f960dc7206a612940826e425ca9f065740
[I 20:52:09.423 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 20:52:17.303 NotebookApp] Creating new notebook in 
[I 20:52:17.752 NotebookApp] Kernel started: 66454176-a4a3-4d56-b1d9-4ef88fa0195d
Traceback (most recent call last):
  File "/Users//anaconda/bin/jupyter-cling-kernel", line 4, in <module>
    main()
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 344, in main
    ClingKernelApp.launch_instance()
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-120>", line 2, in initialize
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 454, in initialize
    self.init_kernel()
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 365, in init_kernel
    user_ns=self.user_ns,
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 101, in __init__
    whichCling = os.readlink(shutil.which('cling'))
TypeError: readlink: path should be string, bytes or os.PathLike, not NoneType
[I 20:52:20.755 NotebookApp] KernelRestarter: restarting kernel (1/5)
Traceback (most recent call last):
  File "/Users//anaconda/bin/jupyter-cling-kernel", line 4, in <module>
    main()
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 344, in main
    ClingKernelApp.launch_instance()
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-120>", line 2, in initialize
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 454, in initialize
    self.init_kernel()
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 365, in init_kernel
    user_ns=self.user_ns,
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 101, in __init__
    whichCling = os.readlink(shutil.which('cling'))
TypeError: readlink: path should be string, bytes or os.PathLike, not NoneType
[I 20:52:23.761 NotebookApp] KernelRestarter: restarting kernel (2/5)
Traceback (most recent call last):
  File "/Users//anaconda/bin/jupyter-cling-kernel", line 4, in <module>
    main()
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 344, in main
    ClingKernelApp.launch_instance()
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-120>", line 2, in initialize
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 454, in initialize
    self.init_kernel()
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 365, in init_kernel
    user_ns=self.user_ns,
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 101, in __init__
    whichCling = os.readlink(shutil.which('cling'))
TypeError: readlink: path should be string, bytes or os.PathLike, not NoneType
[I 20:52:26.771 NotebookApp] KernelRestarter: restarting kernel (3/5)
Traceback (most recent call last):
  File "/Users//anaconda/bin/jupyter-cling-kernel", line 4, in <module>
    main()
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 344, in main
    ClingKernelApp.launch_instance()
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-120>", line 2, in initialize
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 454, in initialize
    self.init_kernel()
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 365, in init_kernel
    user_ns=self.user_ns,
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 101, in __init__
    whichCling = os.readlink(shutil.which('cling'))
TypeError: readlink: path should be string, bytes or os.PathLike, not NoneType
[W 20:52:27.804 NotebookApp] Timeout waiting for kernel_info reply from 66454176-a4a3-4d56-b1d9-4ef88fa0195d
[I 20:52:29.780 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel 66454176-a4a3-4d56-b1d9-4ef88fa0195d restarted
Traceback (most recent call last):
  File "/Users//anaconda/bin/jupyter-cling-kernel", line 4, in <module>
    main()
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 344, in main
    ClingKernelApp.launch_instance()
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-120>", line 2, in initialize
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 454, in initialize
    self.init_kernel()
  File "/Users//anaconda/lib/python3.6/site-packages/ipykernel/kernelapp.py", line 365, in init_kernel
    user_ns=self.user_ns,
  File "/Users//anaconda/lib/python3.6/site-packages/traitlets/config/configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "/Users//anaconda/lib/python3.6/site-packages/clingkernel.py", line 101, in __init__
    whichCling = os.readlink(shutil.which('cling'))
TypeError: readlink: path should be string, bytes or os.PathLike, not NoneType
[W 20:52:32.793 NotebookApp] KernelRestarter: restart failed
[W 20:52:32.794 NotebookApp] Kernel 66454176-a4a3-4d56-b1d9-4ef88fa0195d died, removing from map.
ERROR:root:kernel 66454176-a4a3-4d56-b1d9-4ef88fa0195d restarted failed!
[W 20:52:32.808 NotebookApp] Kernel deleted before session
[W 20:52:32.809 NotebookApp] 410 DELETE /api/sessions/8cb8bf43-8330-4f62-8932-eab94eb8e91c (::1) 2.60ms referer=http://localhost:8888/notebooks/Untitled4.ipynb?kernel_name=cling-cpp14
[I 20:54:17.747 NotebookApp] Saving file at /Untitled4.ipynb

1 个答案:

答案 0 :(得分:0)

  

然后我从桌面打开了一个笔记本,

看起来笔记本在nss_initgroups_ignoreusers中找不到保留二进制文件。当前的主人应该表现得更好,实际上告诉你。您可以尝试从https://root.cern/download/cling/

每晚使用明天

要解决您手头的问题,请从$PATH可访问的终端启动笔记本,例如调整cling,或添加符号链接到$PATH