Jupyter-Notebook和Jupyterlab开机自启动

Jupyter-Notebook

vim /etc/systemd/system/jupyter.service

  

[Unit]
Description=Jupyter Notebook
After=network.target
[Service]
Type=simple
ExecStart=/home/gc/anaconda3/bin/jupyter-notebook --config=/home/wewewt/.jupyter/jupyter_notebook_config.py --no-browser
User=root

Group=root
WorkingDirectory=/home/gc/py
#文件路径名
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

  

systemctl enable jupyter #设置开机自启
systemctl start jupyter #启动

 

Jupyterlab

sudo vim /etc/systemd/system/jupyter.service

  

[Unit]
Description=Jupyterlab
After=network.target
[Service]
Type=simple
ExecStart=/home/gc/anaconda3/bin/jupyter-notebook --config=/root/.jupyter/jupyter_lab_config.py --allow-root
User=wewewt Group=wewewt WorkingDirectory=/home/python #文件路径名 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target

  

sudo systemctl enable jupyter (开机自启动)
sudo systemctl start jupyter  (启动)

  

--no-browser
posted @ 2021-09-19 17:42  吃醋的鱼  阅读(926)  评论(0编辑  收藏  举报