conda install -c conda-forge jupyterlab
执行 jupyter lab --generate-config
生成home/username/.jupyter/jupyter_lab_config.py文件
执行 jupyter lab password (然后输入两次设定的密码即可)
加密后存储在生成的home/username/.jupyter/jupyter_server_config.json里。
sudo nano home/username/.jupyter/jupyter_lab_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 中切换
jupyter-lab 3.0 默认带有 debugger,所以不需要额外安装,但缺少依赖包,需要安装:
conda install -c conda-forge xeus-python
- conda install -c conda-forge jupyterlab-lsp
- conda install -c conda-forge python-lsp-server
输入 jupyter lab
- # ip(远程访问需要改为0.0.0.0)
- c.ServerApp.ip='localhost'
-
- # 密码(从那个json文件里复制过来,否则密码提示错误)
- c.ServerApp.password = ''
-
- # 自动打开浏览器
- c.ServerApp.open_browser = False
-
- # 指定一个端口
- c.ServerApp.port = 8888
-
- # 更改默认启动目录
- c.ServerApp.notebook_dir = '/home/yyx/code'
-
- #内联
- c.IPKernelApp.pylab = 'inline'
以上