树莓派3B+安装JupyterLab

8 篇文章 0 订阅
3 篇文章 0 订阅

 

1.安装pip3

升级库列表

sudo apt-get update

查询是否有pip3的库,找到python3-pip

sudo apt-cache search pip

安装python3-pip

sudo apt-get install python3-pip

2.安装jupyterlab

sudo pip3 install jupyterlab

3.配置JupiterLab生成密码,网上多数说的是使用from notebook.auth import passwd生成密码,不对,请使用from jupyter_server.auth import passwd生成密码

pi@raspberrypi:~/pythonproj/jupyter_lab $ ipython         
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.21.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from jupyter_server.auth import passwd

In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:8e218189c7c2:3526d8f943413ba0dfced32b569def971742a4f1'

In [3]: exit
pi@raspberrypi:~/pythonproj/jupyter_lab $ 

生成配置文件

pi@raspberrypi:~/pythonproj/jupyter_lab $ jupyter lab --generate-config
Writing default config to: /home/pi/.jupyter/jupyter_lab_config.py
pi@raspberrypi:~/pythonproj/jupyter_lab $ sudo vi /home/pi/.jupyter/jupyter_lab_config.py

修改后的内容如下:

pi@raspberrypi:~ $ grep -P "^[^#]" /home/pi/.jupyter/jupyter_lab_config.py
c.ServerApp.allow_remote_access = True
c.ServerApp.allow_root = True
c.ServerApp.ip = '*'
c.ServerApp.password = u'sha1:8e218189c7c2:3526d8f943413ba0dfced32b569def971742a4f1'
pi@raspberrypi:~ $ 

启动jupyter lab

jupyter-lab

浏览器输入:http://raspberrypi:8888/lab,即可打开jupyter

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值