gpt4 book ai didi

linux - Jupyter notebook 运行通过/etc/rc.local 找不到内核

转载 作者:太空狗 更新时间:2023-10-29 12:01:13 25 4
gpt4 key购买 nike

我在带有 python2(默认)和 ITorch 内核的 EC2 实例上有一个 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

最佳答案

@Thomas K 评论解决了它:

“ITorch 内核可能是为你的用户设置的,当系统运行它时,它是不同的用户。运行 jupyter kernelspec list 查看内核在哪里,以及 ITorch 是否在您的主目录,将其复制到 /usr/local/share/jupyter/kernels/”。

关于linux - Jupyter notebook 运行通过/etc/rc.local 找不到内核,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35723309/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com