Jetson Orin NX jupyter lab的安装和使用

主要是为了梳理一下整个过程,其实步骤很简单,但容易出错。

注意,实际只有两个文件需要写入,一个是jupyter_lab_config.py ,一个是jupyter.service

配置文件的名字要写对,如果总是copy网上的代码,可能会出现不同的config,前前后后很混乱。

1.首先更新pip3安装jupyter lab

bash 复制代码
pip3 install --upgrade pip  # 更新 pip3 到最新版本
pip3 install jupyter jupyterlab  # 安装或更新 Jupyter Lab

2.生成配置文件

bash 复制代码
jupyter lab --generate-config

会生成一个jupyter_lab_config.py文件,位于.jupyter目录下。

3.配置文件

bash 复制代码
sudo vim /home/lrhan/.jupyter/jupyter_lab_config.py

写入

bash 复制代码
c.NotebookApp.ip = '0.0.0.0'  # 允许远程访问
c.NotebookApp.port = 8888  # 端口号
c.NotebookApp.open_browser = False  # 不自动打开浏览器
c.NotebookApp.token = ''  # 关闭 Token 认证
c.NotebookApp.password = ''  # 关闭密码认证
c.NotebookApp.allow_remote_access = True  # 允许远程访问

4.设置开机自启动

先查看一下jupyter-lab的安装位置

bash 复制代码
which jupyter-lab

创建jupyter.service文件

bash 复制代码
sudo vim /etc/systemd/system/jupyter.service
bash 复制代码
[Unit]
Description=Jupyter Lab
After=network.target

[Service]
Type=simple
User=lrhan
Group=lrhan
WorkingDirectory=/home/lrhan
ExecStart=/home/lrhan/.local/bin/jupyter-lab --ip=0.0.0.0 --port=8888 --no-browser
Restart=always
Environment="PATH=/home/lrhan/.local/bin:/usr/bin:/bin"

[Install]
WantedBy=multi-user.target

注意

如果中间多次配置,请注意杀死进程,重启jupyter!!!

如果配置文件设置正确,并且你想要确保新的配置生效,执行以下命令来重启 Jupyter 服务:

bash 复制代码
pkill -9 -f jupyter  # 杀死所有 Jupyter 进程
sudo systemctl restart jupyter  # 重新启动 Jupyter

然后可以使用下面的命令检查 Jupyter 是否在运行,并且没有 Token:

bash 复制代码
jupyter lab list

http://lrhan-desktop:8888/lab

现在你可以通过浏览器直接访问:

bash 复制代码
http://<Jetson_IP>:8888/lab
相关推荐
chlk1231 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑1 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件1 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号1 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash2 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI2 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行3 天前
Linux和window共享文件夹
linux
木心月转码ing3 天前
WSL+Cpp开发环境配置
linux
崔小汤呀4 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应4 天前
vi编辑器使用
linux·后端·操作系统