简体   繁体   English

Python 文件未在 vscode docker 容器中调试

[英]Python file not debugging in vscode docker container

Opened VSCode.打开 VSCode。 Started container by docker extension.通过 docker 分机启动容器。 Attached visual studio code with container.附上带有容器的 visual studio 代码。 Start debugging but nothing shows on terminal.开始调试但终端上没有任何显示。 Added break points, debugging not started.添加断点,调试未启动。 Debugging palette appears for a while.调试面板会出现一段时间。 Start debugging but nothing shows on terminal.开始调试但终端上没有任何显示。 Added break points, debugging not started.添加断点,调试未启动。 Debugging palette appears for a while.调试面板会出现一段时间。 Tried reinstall, restart laptop, remote python extension in prerelease version.尝试重新安装,重新启动笔记本电脑,预发布版本中的远程 python 扩展。

**VScode**
Version: 1.69.1 (user setup)  
Commit: b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a  
Date: 2022-07-12T08:21:24.514Z  
Electron: 18.3.5  
Chromium: 100.0.4896.160 
Node.js: 16.13.2 V8: 10.0.139.17-electron.0  
OS: Windows_NT x64 10.0.19044

Python Extension in docker container: v2022.10.1 Python docker 容器中的扩展:v2022.10.1

Problem is caused by python extension(microsoft) in container.问题是由容器中的 python 扩展(微软)引起的。 Downgraded python extension from v2022.10.1 to v2022.8.0 in container extensions.在容器扩展中将 python 扩展从 v2022.10.1 降级到 v2022.8.0。 Problem solved.问题解决了。

Had the same problem有同样的问题

I solved it by opening my folder in VS Code.我通过在 VS Code 中打开我的文件夹解决了这个问题。

  1. File -> Open Folder文件 -> 打开文件夹
  2. A window will pop up, navigate to your project folder将弹出一个 window,导航到您的项目文件夹在此处输入图像描述
  3. After that, start debugging, it should be wokring now.之后开始调试,应该可以正常运行了。 If debugging is working, it will pop up a window like this.如果调试正常,会弹出这样一个window。 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 VSCode 调试在 Docker 容器中执行的 Python 脚本? - Debugging a Python script executed in a Docker container with VSCode? 使用 vscode 在 docker 容器中打开一个文件 - open a file in docker container with vscode VsCode远程调试,更改pythonpath指向Docker容器的python解释器 - VsCode Remote Debugging, change pythonpath to point to docker container's python interpreter 如何在 Docker 容器中获取 Python/vscode 调试的错误消息 - How can I get the error message of Python/vscode debugging inside a Docker container 使用 Xdebug 作为调试器在 Docker 容器上使用 VSCode 调试 Laravel - Debugging Laravel with VSCode on Docker container using Xdebug as debugger 在 docker 容器中调试 React 应用程序时,VSCode 断点未绑定 - VSCode breakpoints unbound when debugging a React app in a docker container 一步即可使用VSCode调试Docker容器中的NodeJs程序 - Debugging NodeJs Program in Docker Container with VSCode in one step vscode 中的未绑定断点,用于在 docker 容器中调试 nodejs 应用程序 - Unbound breakpoint in vscode for debugging nodejs app in a docker container VSCode/Intellij docker容器中Tomcat/Wildfly服务器远程调试 - Remote Debugging of Tomcat/Wildfly server in docker container in VSCode/Intellij Docker 容器中的 VS Code 远程调试 Python - VS Code Remote Debugging Python in a Docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM