1,先安装一些依赖
sudo apt install nodejs npm
2,安装pip3包管理器
sudo apt install python3-pip
sudo pip3 install pillow==6.2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
3,安装jupter lab
pip3 install jupyter jupyterlab
4,重启
sudo reboot
5,启动jupyter lab
现在,已经安装好。
在命令行输入jupyter lab
命令, 即可启动jupyter lab。
先关闭已经启动的Jupyter lab进程,操作方法是,在当前终端窗口中按 ctrl
+c
现在开始解决以上问题:
6,生成jupyter lab 配置文件
jupyter lab --generate-config
输入命令后,会看到类似的输出信息:
会提示配置文件保存在以下路径:
Writing default config to: /home/bbot/.jupyter/jupyter_notebook_config.py
其中,路径上的“bbot”是我们的用户名,这个位置的信息会根据你设置的用户名有所不同。
7,使用编辑器,编辑jupyter lab配置文件
我比较喜欢用nano,有大神用vi&vim的,只要能编辑就好,创客出手输入以下命令:
nano /home/bbot/.jupyter/jupyter_notebook_config.py
找到以下两项参数,去掉前面的#
,并修改成如下参数即可
...
c.NotebookApp.allow_origin = '*' # allow all origins
...
c.NotebookApp.ip = '0.0.0.0' # listen on all IPs
8,设置密码
jupyter notebook password
这时,会见到Enter password:
,这时输入你的密码按回车(此时命令行上不会出现任何东西,这是正常现象)
之后,会见到Verify password:
,再次输入你的密码按回车,验证两次输入是否一致(此时命令行上不会出现任何东西,这是正常现象)
再之后,会提示密码已经保存到配置文件中[NotebookPasswordApp] Wrote hashed password to /home/bbot/.jupyter/jupyter_notebook_config.json
- $ chromium-browser --no-sandbox
- $ jupyter lab
- (it run smoothly)
cd ~
mkdir ssl
cd ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem
启动notebook
jupyter notebook --certfile=~/ssl/mycert.pem --keyfile ~/ssl/mykey.key &
jupyter lab --certfile=~/ssl/mycert.pem --keyfile ~/ssl/mykey.key &
最后,再次使用jupyter lab
命令。
现在,局域网的主机也可以访问,输入Jetson nano 的ip地址加端口8888,例如:http://ipaddress:8888 ,提示输入密码,输入你设置的密码即可。