前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >为 jupyterlab 添加 debugger 扩展

为 jupyterlab 添加 debugger 扩展

作者头像
为为为什么
发布2022-08-05 15:38:33
2K0
发布2022-08-05 15:38:33
举报
文章被收录于专栏:又见苍岚又见苍岚

jupyterlab 作为 jupyter 的扩展版本,易用性强,结果保存很合理。突然发现可以添加debugger插件,实现在jupyterlab中调试代码,本文记录方法。

基本流程

  • 安装 Anaconda
  • 安装 jupyterlab
  • 安装 node.js
  • 安装 xpython
  • 建立 jupyterlab 工程
  • 搜索并安装插件
  • 使用插件进行debug

具体步骤

安装Anaconda
安装jupyterlab
代码语言:javascript
复制
pip install jupyterlab
安装 node.js

如果不装会报错:

代码语言:javascript
复制
An error occurred installing <code>@jupyterlab/debugger-extension</code>.
Error message:

Please install Node.js and npm before continuing installation. You may be able to install Node.js from your package manager, from conda, or directly from the Node.js website (https://nodejs.org).

代码语言:javascript
复制
wget https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-x64.tar.xz    // 下载
tar xf node-v14.17.3-linux-x64.tar.xz                                   // 解压

之后添加环境变量到 /etc/profile~/.bashrc 文件

代码语言:javascript
复制
export PATH=$PATH:/path_to/node-v14.17.3-linux-x64/bin
  • 测试
代码语言:javascript
复制
# node -v
v14.17.3

安装 xpython
代码语言:javascript
复制
pip install xeus-python

JupyterLab 2.0+ xeus-python 0.8.0+ notebook 6+

  • 随后可以使用 xpython
建立 jupyterlab 工程
代码语言:javascript
复制
jupyter lab --allow-root --no-browser --ip 0.0.0.0 --port 8080 --notebook-dir /workspace/nfs
搜索并安装插件
  • 进入 jupyterlab, enable Warning 中的内容即可使用扩展
  • 搜索并安装插件

安装 @jupyterlab/debugger

  • 可以搜索之间单击 install
  • 也可以执行命令
代码语言:javascript
复制
jupyter labextension install @jupyterlab/debugger

使用插件进行debug
  • 建立 xpython 工程
  • 设置断点,debug 程序

参考资料

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021年7月8日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 基本流程
  • 具体步骤
    • 安装Anaconda
      • 安装jupyterlab
        • 安装 node.js
          • 安装 xpython
            • 建立 jupyterlab 工程
              • 搜索并安装插件
                • 使用插件进行debug
                • 参考资料
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档