如何在 Visual Studio Code 中开始调试 Python 3.6? [英] How to start debugging Python 3.6 in Visual Studio Code?

查看:58
本文介绍了如何在 Visual Studio Code 中开始调试 Python 3.6?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用此 IDE 创建一些脚本,但无法使其工作.我安装了 Python 3.6,添加到路径(最终可见),安装了 Python 扩展(我相信来自 Microsoft).

然后我尝试了这个手册 https://code.visualstudio.com/docs/python/环境,但我坚持第一步.

当我尝试命令 Select Workspace interpreter 时,出现以下错误:

<块引用>

找不到命令python.setInterpreter"

我不明白这是什么意思.谷歌在这个问题上找不到任何东西,只有一些不再存在的github页面.

如果我尝试开始调试,它会显示:

<块引用>

找不到命令python.python-debug.startSession"

操作系统:Windows 7另外我想测试在虚拟环境中创建的脚本,也许这是它不起作用的原因,但我不知道该怎么做.

UPD:我卸载并重新安装了扩展程序.我没有看到这些错误,但调试仍然无法正常工作,只是加载 CPU 并忽略任何断点.

解决方案

它对我有用,进入 ~/.vscode/extensions/,手动删除扩展的文件夹并重新安装它.>

I'm trying to create some script using this IDE but I can't make it work. I installed Python 3.6, added to path (it's visible finally), installed Python extension (from Microsoft I believe).

Then I tried this manual https://code.visualstudio.com/docs/python/environments but I'm stuck on the first step.

When I try the command Select Workspace interpreter I have the following error:

command 'python.setInterpreter' not found

I'm puzzled what it means. Google can't find anything on this issue, only some github pages that don't exist anymore.

And if I try to start debugging it shows:

command 'python.python-debug.startSession' not found

OS: Windows 7 Also I want to test scripts created in virtual environment, maybe it's a reason why it doesn't work but I have no idea how to do it.

UPD: I uninstalled and installed the extension again. I don't see these error but debugging still doesn't work just loading CPU and ignoring any breakpoints.

解决方案

It worked for me going into ~/.vscode/extensions/, deleting the extension's folder manually and reinstalling it again.

这篇关于如何在 Visual Studio Code 中开始调试 Python 3.6?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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