Note: This development environment has been built in the factory image. You can skip this tutorial if you use the factory image.
Since Jetson Orin NX/Orin Nano uses Docker and the system environment is already available, this installation takes Jetson Nano as an example.
First, install Jupyter Lab from Tsinghua source (the installation and download speed of this source in China is relatively fast at present, and other sources can also be used for installation). During the installation, some dependent packages need to be downloaded from the external network, and occasionally the connection will be disconnected, causing the installation to fail. You can execute the installation command again and continue the installation from the breakpoint.
xxxxxxxxxx
sudo pip3 install jupyterlab -i https://pypi.tuna.tsinghua.edu.cn/simple
When successfully appears, it means that Jupyter Lab is installed, but it should be noted that the above alarm information does not find the path. If this problem is not solved, Jupyter Lab cannot be used.
Modify the profile configuration file
xxxxxxxxxx
sudo nano /etc/profile
Add configuration instructions, as shown in the figure
xxxxxxxxxx
export PATH=$PATH:~/.local/bin
After writing, press Ctrl+S to save, and then press Ctrl+X to exit.
Then execute
xxxxxxxxxx
source /etc/profile
Start jupyterlab. After starting, the browser will automatically pop up the jupyterlab interface.
xxxxxxxxxx
jupyter lab
If you want to run it on other devices in the same LAN, you need to follow the following process
Open the terminal and enter the following content in sequence, and then enter the password twice according to the prompt. It is recommended to be consistent with the user password.
xxxxxxxxxx
ipython
from jupyter_server.auth import passwd
passwd()
A string of keys will be generated after the password confirmation is completed. Copy this key and enter the following command to exit.
xxxxxxxxxx
exit()
After creation, the detailed location of the file will be output, please remember this location.
xxxxxxxxxx
jupyter lab --generate-config
xxxxxxxxxx
nano ~/.jupyter/jupyter_lab_config.py
Add the following content, where the password item needs to be replaced with the key generated above.
xxxxxxxxxx
c.ServerApp.allow_remote_access = True
c.ServerApp.allow_root = True
c.ServerApp.ip = '0.0.0.0'
c.ServerApp.open_browser = False
c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$nUGOAFK4hllD6AZCI00SaA$y/V3VPsHxRp8aox4Qx/p0jOG2/dAYPW4dO0x23lxaxc'
c.ServerApp.port = 8888
After writing, press Ctrl+S to save, and then press Ctrl+X to exit.
Restart the system
xxxxxxxxxx
sudo reboot
Step 5: Run the test
xxxxxxxxxx
jupyter lab
You can access http://127.0.0.1:8888 in your local browser or http://
For example: If the robot's address is 192.168.1.220, then the machine in the LAN should access http://192.168.1.220:8888 as shown below:
After the installation is complete, under normal circumstances, each time you use JupyterLab, you need to enter the command jupyter lab to start. For convenience, we configure the startup program. The operation is as follows:
Step 1: Create a startup file
xxxxxxxxxx
sudo vim /etc/systemd/system/yahboom_jupyterlab.service
Step 2: Copy the code to this file, save and exit
jetson nano system service file
xxxxxxxxxx
[Unit]
Description=Jupyter Lab Service
[Service]
Type=simple
User=jetson
Environment="OPENBLAS_CORETYPE=ARMV8"
ExecStart=/bin/sh -c "jupyter lab --ip=0.0.0.0 --no-browser"
WorkingDirectory=/home/jetson
Restart=always
[Install]
WantedBy=multi-user.target
Raspberry Pi system service file
xxxxxxxxxx
[Unit]
Description=Jupyter Lab Service
[Service]
Type=simple
User=pi
Environment="OPENBLAS_CORETYPE=ARMV8"
ExecStart=/bin/sh -c "jupyter lab --ip=0.0.0.0 --no-browser"
WorkingDirectory=/home/pi
Restart=always
[Install]
WantedBy=multi-user.target
After writing, press Ctrl+S to save, and then press Ctrl+X to exit.
Step 3: Enable the service to start automatically at boot
xxxxxxxxxx
sudo systemctl daemon-reload
sudo systemctl enable yahboom_jupyterlab.service
sudo systemctl restart yahboom_jupyterlab.service
Step 4: Restart the system
xxxxxxxxxx
sudo reboot
Try to access http://127.0.0.1:8888 locally
Or
Access http://《your-ip-address》:8888 on a machine in the LAN, such as: http://192.168.1.220:8888
If the access is normal, the Jupyter Lab environment is successfully built!