2
我有一個EC2實例上的python2(默認)和ITorch內核的Jupyter Notebook服務器。通過SSH命令行運行時,一切正常。Jupyter筆記本通過/etc/rc.local運行時找不到內核
問題是,當我嘗試在啓動時運行此操作時,筆記本服務器找不到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
ITorch內核可能是爲您的用戶設置的,當系統運行它時,它是一個不同的用戶。運行'jupyter kernelspec list'來查看內核的位置,如果ITorch位於你的主目錄下,將它複製到'/ usr/local/share/jupyter/kernels /' –
那就行了。很簡單!我想我需要提高我的UNIX技能。謝謝。 – mbiron