Tengo un servidor Jupyter Notebook en una instancia EC2 con python2 (predeterminado) y núcleos ITorch. Todo funciona bien cuando se ejecuta a través de la línea de comandos SSH.
El problema es que cuando trato de hacer que esto se ejecute al inicio, el servidor de la computadora portátil no puede encontrar el kernel de ITorch. Sin embargo, funciona bien para portátiles de Python. El error que recibo es una ventana que dice
Kernel not found I couldn't find a kernel matching iTorch. Please select a kernel: (python2) Lo que hice fue agregar esta línea a /etc/rc.local
/home/ubuntu/anaconda2/bin/jupyter-notebook --JupyterApp.config-file=/home/ubuntu/.jupyter/jupyter_notebook_config.py &> /dev/null &El servidor portátil aparentemente funciona bien. Esto es del registro del sistema.
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).Estas son las únicas líneas que modifiqué en mi archivo de configuración
# 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 = 8888El comentario de @Thomas K lo resolvió:
"El kernel de ITorch probablemente esté configurado para su usuario, y cuando el sistema lo ejecuta, es un usuario diferente. Ejecute jupyter kernelspec list para ver dónde están los kernels, y si ITorch está en su directorio de inicio, cópielo en /usr/local/share/jupyter/kernels/ ".