栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Ubuntu20.04 安装 JupyterLab

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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'
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/689084.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号