0%

VSCode调试Python2.7代码

问题

VSCode使用最新版本Python插件,调试Python2代码无反应

原因

Python插件调试时需要调用 debugpy,debugpy在2022-03-25发布v1.6.0后不再支持调试Python 2

解决

  • 右键Python插件,选择安装另一个版本,选择版本:2022.2.1924087327

如果同时需要使用Pylance,则需要将Pylance安装为同时期发布的版本,比如:2022.2.4,否则会产生以下报错:Couldn't start client Python Tools

Request initialize failed with message: You may install and use any number of copies of the software only with Microsoft Visual Studio, Visual Studio for Mac, Visual Studio Code, Azure DevOps, Team Foundation Server, and successor Microsoft products and services (collectively, the “Visual Studio Products and Services”) to develop and test your applications. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. You may not: work around any technical limitations in the software that only allow you to use it in certain ways; reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software, except and to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; use the software in any…

欢迎关注我的其它发布渠道