【问题标题】:VS Code: jupyter notebook run line by lineVS Code:jupyter notebook 逐行运行
【发布时间】:2021-04-17 19:39:10
【问题描述】:

最近 VSCode 得到了更新,之后我的 jupyter notebook 界面发生了变化,这给我带来了很多问题。现在我不知道如何逐行运行单元格代码等。

有没有其他方法可以做到这一点,或者我怎样才能恢复到旧版本的笔记本?

【问题讨论】:

    标签: visual-studio-code jupyter-notebook


    【解决方案1】:
    1. 打开命令面板(Windows 上为 Ctrl+Shift+P,Mac 上为 Cmd+Shift+P)
    2. 键入“首选项:打开设置 (JSON)”并选择第一个选项以打开您的用户 settings.json 文件
    3. 将以下行添加到您的用户 settings.json 文件中:
    "jupyter.experiments.optOutFrom": ["NativeNotebookEditor"],
    
    1. 如果您的用户 settings.json 文件中存在以下条目,请删除它:
    "workbench.editorAssociations": [
      {
        "viewType": "jupyter-notebook",
        "filenamePattern": "*.ipynb"
      }
    ]
    
    1. 重新加载 Visual Studio Code 以使新设置生效。您应该选择重新使用旧的 Jupyter 笔记本界面。

    【讨论】:

      【解决方案2】:

      在 v1.60 中(参见https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_60.md#jupyter):

      VS Code 现在支持 Jupyter 笔记本中的 Run By Line 功能。 这是一种简单的调试模式,可让您执行单元格的代码 逐行。要试用它,只需确保您已将 ipykernel v6+ 安装为您选择的内核,然后选择 Run By Line 按钮。


      以前:

      在 vscode 1.59 中(见https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#jupyter-run-by-line

      Jupyter“逐行运行”

      我们一直致力于支持 Jupyter 中的“Run By Line”功能 笔记本。此功能本质上是一种简化的调试模式, 让您逐行遍历单元格的代码,而无需任何 复杂的调试用户界面。这仍然是实验性的,但您可以尝试一下 通过设置"jupyter.experimental.debugging": true,安装 选择内核中的 ipykernel 版本 6,然后单击“运行 单元格工具栏中的“按行”按钮。

      "jupyter.experimental.debugging": true


      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-31
        • 1970-01-01
        • 2018-01-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多