Welcome to DOFBOT SE repository
1.Jupyter Lab environment construction
Installing JupyterLab (Optional)
[!CAUTION]
This section is optional content. Users utilizing our provided virtual machine image should skip this section.
1. Introduction to JupyterLab
JupyterLab is an interactive development environment—the next-generation successor to the classic Jupyter Notebook. It integrates a wider range of features, supports plugin extensions, and can be operated entirely through a web browser. Simple, convenient, and powerful, it is an exceptional code editing tool well worth using.
2. Switching to the Root User
Installing JupyterLab requires root privileges. By default, the system's root user account has no password assigned and cannot be directly switched to; therefore, you must set a password for the root user before you can access the account.
Note: You must remember the password you set for the root user here. It is highly recommended to make it identical to your standard user password to ensure you do not forget it easily.
- Enter the following command to set a password for the root user, then enter the same password twice to confirm.
xxxxxxxxxxsudo passwd

- Switch to the root user.
xxxxxxxxxxsudo su

As shown in the image above, you have successfully switched to the root user. Additionally, the $ symbol preceding the command prompt has changed to a # symbol.
3. Installing JupyterLab
- Install the ffi library
xxxxxxxxxxapt-get install libffi-dev

- Install Jupyter
xxxxxxxxxxpip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyter

- Install JupyterLab
xxxxxxxxxxpip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab

- Switch back to the standard user account after installation is complete
xxxxxxxxxxsu jetson

4. Configuring JupyterLab
- Generate the configuration file
xxxxxxxxxxjupyter notebook --generate-config

- Use IPython to generate the login password for JupyterLab.
ipython
At In [1], enter: from notebook.auth import passwd
At In [2], enter: passwd()
Then, enter the same password twice and press Enter to confirm. Note that this password is used for logging into the JupyterLab interface; for ease of recall, you may choose to keep it identical to your user account password. The system will then output the encrypted password hash; copy this entire block of text. Since the hash generated for each password may vary, please ensure you copy the specific text output by your system. In the In [3] cell, enter: exit()

- Configure the Jupyter configuration file
nano ~/.jupyter/jupyter_notebook_config.py
Scroll directly to the very end of the file and add the following content:
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.password = [The entire hashed password string]
c.NotebookApp.port = 8888

Finally, press Ctrl+S to save and Ctrl+X to exit.
5. Installing JupyterLab Extensions
- Install Node.js and npm
xxxxxxxxxxsudo apt install nodejs npm

- Install the Jupyter Widgets extension. Since this involves downloading and compiling, the process may take some time and could potentially encounter errors. If an error occurs, simply rerun the installation command.
xxxxxxxxxxsudo jupyter labextension install @jupyter-widgets/jupyterlab-manager

- Install the Status Bar extension
xxxxxxxxxxsudo jupyter labextension install @jupyterlab/statusbar

- At this point, the installation of JupyterLab is complete.
6. Launching JupyterLab
- Navigate to the directory where you intend to run your code. For this example, we will navigate to the root directory.
- To launch JupyterLab, open a terminal window and enter the following command:
xxxxxxxxxxjupyter lab

The port number displayed here is the one you will need to access. By default, this corresponds to the port specified by c.NotebookApp.port in the Jupyter configuration file (configured in the previous step). If you launch multiple JupyterLab instances simultaneously, the port number will automatically increment by 1, allowing you to distinguish between different JupyterLab services.
7. Remote Access to JupyterLab
- Open a web browser on your local computer (Chrome or Firefox is recommended), and then enter the following address:
[Virtual Machine IP Address]:[Port Number]. For this example, we will use the IP address 192.168.2.116 and port 8888. The JupyterLab interface will appear, prompting you to enter a password; simply enter the JupyterLab login password you configured earlier to proceed.

- Once you see the interface shown below, it indicates that you have successfully logged into JupyterLab remotely. You can now create and run new Python 3 programs.

8. Exiting JupyterLab
To exit JupyterLab, simply press Ctrl+C twice in the terminal window where you originally launched the application.