jupyterlab extension添加插件及配置

安装node

因为jupyterlab extension依赖于node,所以需要先安装

Linux

这里找到合适的版本复制链接
在这里插入图片描述
下载:

wget https://nodejs.org/dist/v14.18.1/node-v14.18.1-linux-x64.tar.xz

解压:

tar xvf node-v14.18.1-linux-x64.tar.xz

添加软连接,出现Permission denied就加sudo

ln -s /home/ubuntu/node-v14.18.1-linux-x64/bin/node /usr/local/bin/node
ln -s /home/ubuntu/node-v14.18.1-linux-x64/bin/npm /usr/local/bin/npm

查看安装配置是否成功:

node -v
npm -v

改配置文件

在jupyterlab中可以添加一些插件或者做一些设置,使你的工作更加方便。
开启Extension Manager
在这里插入图片描述
Settings > Advanced Settingd Editor打开Settings文件,
选择需要设置的内容,将System Defaults复制到User Preferences,并将对应的值修改。
然后Ctrl + s保存生效。

在这里插入图片描述

修改UI主题

像下面的图片一样
这里我修改了主题,选择Theme,将"JupyterLab Light"改为"JupyterLab Dark";也修改了滚动条的风格。
在这里插入图片描述

设置显示行号

选择Notebook进行设置

    // Code Cell Configuration
    // The configuration for all code cells.
    "codeCellConfig": {
        "lineNumbers": true,
    },
        
    // Markdown Cell Configuration
    // The configuration for all markdown cells.
    "markdownCellConfig": {
        "lineNumbers": true,
    },
        
    // Raw Cell Configuration
    // The configuration for all raw cells.
    "rawCellConfig": {
        "lineNumbers": true,
    },

查看插件

列出所有插件查看插件的使用情况:

jupyter labextension list

jupyterlab-execute-time

这个插件可以帮助我们在 jupyter lab 中记录每个cell的执行开始以及运行耗时。
在这里插入图片描述

安装

  1. 使用conda安装
conda install -c conda-forge jupyterlab_execute_time
  1. 使用pip安装
pip install jupyterlab_execute_time
  1. 使用jupyter labextension安装
jupyter labextension install jupyterlab-execute-time

由于我这里使用conda和jupyter labextension安装都失败,所以选择的是pip安装

配置

安装完成之后在Notebook中设置

    // Recording timing
    // Should timing data be recorded in cell metadata
    "recordTiming": true,

jupyterlab-system-monitor

这个插件用于显示系统信息(内存和CPU的使用情况)

安装

pip install jupyterlab-system-monitor

配置

jupyter lab --generate-config

这个命令会在~/.jupyter/下生成jupyter_lab_config.py文件,修改文件:

gedit ~/.jupyter/jupyter_lab_config.py

将下面内容写入并保存:

c.ResourceUseDisplay.mem_limit = 4294967296
c.ResourceUseDisplay.track_cpu_percent = True
c.ResourceUseDisplay.cpu_limit = 2

可以修改内存使用限制和cpu限制

c.ResourceUseDisplay.mem_limit = <size_in_GB> *1024*1024*1024
c.ResourceUseDisplay.track_cpu_percent = True
c.ResourceUseDisplay.cpu_limit = <number_of_cpus>

Settings > Advanced Settingd Editor打开Settings文件:
System Monitor可以设置刷新率和显示
重启jupyterlab,在右上角显示,点击可以显示不同形式的占用
在这里插入图片描述
在这里插入图片描述

jupyterlab-python-file

在jupyterlab中创建python文件

安装

  1. pip安装:
pip install jupyterlab-python-file
  1. conda安装
conda install -c conda-forge jupyterlab-python-file

在这里插入图片描述
在这里插入图片描述

jupyterlab-kite --不好用

jupyterlab-kite: Kite 是一个 AI 驱动的编程助手

在Linux从终端运行:bash -c "$(wget -q -O - https://linux.kite.com/dls/linux/current)"
安装完成后,安装程序应自动运行 Kite Engine。
中途会提示Press enter to continue...,只需要回车即可

为 JupyterLab 安装 Kite 扩展
如果您使用的是JupyterLab 3.0.x,只需运行:

pip install " jupyterlab-kite>=2.0.2 "

jupyterlab-lsp

Jupyterlab Language Server Protocol

jupyterlab-lsp:使用语言服务器协议为 JupyterLab 提供编码帮助(代码导航 + 悬停建议 + linters + 自动完成 + 重命名)

前提:
JupyterLab >=3.0.0,<4.0.0a0
Python 3.6+

pip install jupyterlab-lsp
pip install 'python-lsp-server[all]'

如果安装pip install 'python-lsp-server[all]'报错:

ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

执行:

pip install -U wrapt --ignore-installed
pip install 'python-lsp-server[all]' --ignore-installed

重启jupyter lab

jupyterlab-code-snippets

jupyterlab-code-snippets

使用 JupyterLab 代码片段保存、重用和共享代码片段!

pip install jupyterlab-code-snippets

选中要保存的代码段,右键 >> Save As Code Snippets

jupyter-archive

jupyter-archive

将目录中的文件或文件夹打包下载,或者从打包文件中提取文件

pip install jupyter-archive

右键文件夹 >> Download Current Folder as an Archive

jupyterlab-spreadsheet

jupyterlab-spreadsheet

Excel文件查看工具

gator

gator

Conda 环境和包管理扩展

jupyterlab-favorites

jupyterlab-favorites

将文件或文件夹添加到收藏夹,在文件路径较深时,或者文件太多时比较好用,可以快速找到常用的文件。

python -m pip install jupyterlab-favorites

右键文件 >> Add Favorite

jupyterlab-recents

jupyterlab-recents

跟踪最近使用的文件和目录

pip install jupyterlab-recents

左上角File >> Recents

elyra

elyra

以 AI 为中心的方法扩展了 JupyterLab Notebooks

ipyturtle2

在jupyterlab上使用turtle

pip install ipyturtle2
jupyter labextension install @jupyter-widgets/jupyterlab-manager --minimize=False
jupyter labextension install ipyturtle2

持续更新中…

  • 6
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ayiya_Oese

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值