jupyter lab 使用


1、 安装 jupyterlab,代码补全,中文等

pip install jupyterlab
//或者
conda install -c conda-forge jupyterlab

pip install jupyter-lsp
pip install jupyterlab-lsp
pip install python-lsp-server
pip install jupyterlab-language-pack-zh-CN

2、jupyterlab 配置

jupyter lab --generate-config

生成配置文件,并修改配置文件 C:\Users\Administrator.jupyter\jupyter_lab_config.py

#生成密码哈希值后填入配置表
from jupyter_server.auth import passwd
passwd()
Enter password:
Verify password:
c.ServerApp.ip='*'  # 表示所有ip皆可访问
c.ServerApp.password = '******************************'  # 前面生成的密码哈希值
c.LabServerApp.open_browser = False  #  禁止打开浏览器
c.ServerApp.port =8888  # 随便指定一个端口,默认为8888
c.ServerApp.allow_remote_access = True # 允许远程访问

3、jupyterlab 运行命令

\\在指定目录运行
jupyter lab ./
jupyter lab E:\CT\code

4、jupyterlab 安装插件 jupyter lab 搜索插件 @krassowski/jupyterlab-lsp

使用中报错记录

问:

python3.6 绘制时报错:Javascript Error: IPython is not defined

解决:

将%matplotlib notebook 替换为 %matplotlib inline