Ubuntu20.04 安装 JupyterLab

Ubuntu20.04 安装 JupyterLab,第1张

Ubuntu20.04 安装 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 或者
nohub  jupyter lab & (后台启动)

打开相应端口即可通过ip:端口访问JupyterLab,默认端口为 8888

其他配置项:

c.NotebookApp.ip='*'   # ip
c.NotebookApp.password = u'sha1:0e4123fc42:11d14djsayu23j1767631c1232871du81dg' # 密码
c.NotebookApp.open_browser = False
c.NotebookApp.port =9999 #指定一个端口
c.IPKernelApp.pylab = 'inline'

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5689592.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存