I have installed JupyterLab on my Ubuntu 20.04 machine using anaconda.
I would like to start Jupyterlab on boot.
I CAN get Jupyterlab to run on boot by doing the following:
Create the file /etc/systemd/system/jupyter.service
[Unit]
Description=Jupyter Lab
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/USERNAME/anaconda3/envs/jupyterlab/bin/jupyter lab
User=USERNAME
WorkingDirectory=/home/USERNAME/Documents
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
replacing USERNAME.
Then run the following commands:
sudo systemctl daemon-reload
sudo systemctl enable jupyter.service
sudo systemctl restart jupyter.service
sudo systemctl status jupyter.service
HOWEVER, in a jupyter notebook, if I run the command
!python
I get my system python, not my conda environment python.
How can I start jupyterlab on boot, and still get !commands to work as expected?