Ubuntu Server 安装 JupyterLab
Ubuntu Server 安装 JupyterLab

JupyterLab 是 Jupyter 项目的下一代基于Web的用户界面,根据官方文档,JupyterLab 最终将取代经典的 Jupyter Notebook
下面我们看一下如何在 Ubuntu Server 20.04 下安装 JupypterLab 吧
准备工作
安装最新版 Python3、pip3 及 nodejs,用 Anaconda 也可以
安装JupyterLab
pip3 install jupyterlab
# 或者使用
# conda install -c conda-forge jupyterlab
配置Python
生成配置文件
jupyter lab --generate-config
生成密码
输入
jupyter lab password
然后输入两次设定的密码即可
修改配置
vi ~/.jupyter/jupyter_notebook_config.py
并找到以下条目并修改:
# 允许远程访问
c.ServerApp.allow_remote_access = True
# 允许 root 用户
c.ServerApp.allow_root = True
# 启动时不打开浏览器
c.LabServerApp.open_browser = False
# 设置公网访问
c.ServerApp.ip = '0.0.0.0'
安装中文语言包
pip3 install jupyterlab-language-pack-zh-CN
然后在 settings → language 中切换
debugger 语法检测
jupyter-lab 3.0 默认带有 debugger,所以不需要额外安装,但缺少依赖包,需要安装:
pip install xeus-python
# 或
# conda install -c conda-forge xeus-python
代码提示
pip install jupyterlab-lsp
# 或者
# conda install -c conda-forge jupyterlab-lsp
pip install python-lsp-server[all]
启动Jupyter Notebook
jupyter lab
打开相应端口即可通过ip:端口访问JupyterLab,默认端口为 8888
插件(可选)
@jupyterlab/toc @krassowski/jupyterlab_go_to_definition @ryantam626/jupyterlab_sublime
评论