Jupyter笔记本在运行/etc/rc.local时无法找到内核

时间:2016-03-01 12:44:54

标签: linux amazon-ec2 ubuntu-14.04 torch jupyter-notebook

我在EC2实例上有一个带有python2(默认)和ITorch内核的Jupyter Notebook服务器。通过SSH命令行运行时一切正常。

问题在于,当我尝试在启动时运行时,笔记本服务器找不到ITorch内核。我确实为python笔记本工作正常。我得到的错误是一个窗口

Kernel not found
I couldn't find a kernel matching iTorch. Please select a kernel: (python2)

我所做的是将此行添加到/etc/rc.local

 /home/ubuntu/anaconda2/bin/jupyter-notebook --JupyterApp.config-file=/home/ubuntu/.jupyter/jupyter_notebook_config.py &> /dev/null &

笔记本服务器显然运行良好。这是来自系统日志

ip-172-31-20-152 login: [32m[I 12:20:51.073 NotebookApp][0;10m Serving notebooks from local directory: /home/ubuntu/notebook
[32m[I 12:20:51.076 NotebookApp][0;10m 0 active kernels 
[32m[I 12:20:51.078 NotebookApp][0;10m The Jupyter Notebook is running at: https://[all ip addresses on your system]:8888/
[32m[I 12:20:51.081 NotebookApp][0;10m Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

这些是我在配置文件中修改的唯一行

# Configuration file for jupyter-notebook.
c = get_config()
c.NotebookApp.notebook_dir = u'/home/ubuntu/notebook'
c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem'
c.NotebookApp.keyfile = u'/home/ubuntu/certs/mycert.key'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'<password>'
c.NotebookApp.port = 8888

1 个答案:

答案 0 :(得分:3)

@Thomas K评论解决了它:

“ITorch内核可能是为您的用户设置的,当系统运行它时,它是一个不同的用户。运行jupyter kernelspec list以查看内核的位置,如果ITorch位于您的主目录下,则复制它到/usr/local/share/jupyter/kernels/“。