Jupyter Lab是什么?我用多说,网上百度一大把。
我的树莓派os是官网下载的2021-10-30的版本,刷完系统自带python 3.9.2。
1. 安装
使用Jupyter官网的教程,直接安装Jupyter Lab:
$ pip3 install jupyterlab
居然出错了:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tv6azl3y/cffi_79359e18e89b40a5b626890ecf238c19/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tv6azl3y/cffi_79359e18e89b40a5b626890ecf238c19/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-mowal4g9
cwd: /tmp/pip-install-tv6azl3y/cffi_79359e18e89b40a5b626890ecf238c19/
Complete output (56 lines):
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
一堆英文,欲哭无泪,其实重点在第5行,后面不断重复提醒,我就是没留意(T T)。
发现问题,装上就是了:
$ sudo apt-get install libffi-dev
装上libffi-dev包,再重新安装Jupyter Lab,马上OK。
2. 配置
创建配置文件
在终端下执行命令:
$ jupyter lab --generate-config
Writing default config to: /home/pi/.jupyter/jupyter_lab_config.py
修改设置局域网能访问Jupyter lab
编辑刚刚生成的配置文件
$ vi ~/.jupyter/jupyter_lab_config.py