VSCode:Jupyter Notebook 的代码镜头不显示调试选项或“按行运行代码" [英] VSCode: Code Lens for Jupyter Notebook does not show debug option or "run code by line"

查看:129
本文介绍了VSCode:Jupyter Notebook 的代码镜头不显示调试选项或“按行运行代码"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然是 vscode 的新手,但我无法让 Python Jupyter 笔记本的一些工具在 VSCode 版本:1.56.2 上在 ubuntu linux 20.04 LTS 中工作.

I am still new to vscode, but I am having trouble getting some of the tools for python Jupyter notebooks to work in VSCode Version: 1.56.2 on ubuntu linux 20.04 LTS.

因此,根据文档,应该有用于调试的按钮,包括按行运行代码"的按钮.这样可以更轻松地调试笔记本单元中的任何代码问题.文档建议笔记本界面应如下所示.

So according to the documentation, there are supposed to be buttons for debugging, including a button to "run code by line". This makes it easier to debug any code issues in a notebook cell. The documentation suggests the notebook interface should look like this.

左上角的按钮是我感兴趣的按钮.

The buttons in the upper left are the ones that I am interested in.

现在,当我查看自己的界面时,它看起来像这样.

Now, when I look at my own interface, it looks like this.

所以这两个界面看起来很不一样.我不确定是否需要更改 VSCode 中的任何设置以启用这些按钮.文档 没有提到对任何设置的更改.

So the two interfaces look very different. I am not sure if I need to change any settings in VSCode to enable these buttons. The documentation did not mention changes to any settings.

如有任何建议,我们将不胜感激.

Any suggestions would be appreciated.

推荐答案

按行运行代码"您看到的新笔记本界面尚未实现.同时,您可以通过按行运行代码"选择返回到旧界面.通过执行以下操作来支持:

"Run code by line" has not yet been implemented for the new notebooks interface that you are seeing. In the meantime, you can opt back into the old interface with "Run code by line" support by doing the following:

  1. 通过键入 Ctrl+Shift+P > 打开您的用户 settings.json首选项:打开设置 (JSON)"
  2. 将以下行添加到您的用户 settings.json 文件中:

"jupyter.experiments.optOutFrom": ["NativeNotebookEditor"]

  1. 如果您的 settings.json 文件中存在 workbench.editorAssociations 设置,请将其删除.
  2. 重新加载 VS Code 以使新设置生效

这篇关于VSCode:Jupyter Notebook 的代码镜头不显示调试选项或“按行运行代码"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆