小编Phi*_*ipp的帖子

在 VS Code 中调试 Python 时出错:如果指定了“python”,“pythonPath”无效

我收到一条提示:

Invalid Message: "pythonPath" is not valid if "python" is specified 
Run Code Online (Sandbox Code Playgroud)

以及打开 launch.json 的选项。但我的 launch.json 不包含任何显示“pythonPath”的内容:

Invalid Message: "pythonPath" is not valid if "python" is specified 
Run Code Online (Sandbox Code Playgroud)

这是我的tasks.json:

{
  "configurations": [
    {
      "name": "Docker: Python - General",
      "type": "docker",
      "request": "launch",
      "preLaunchTask": "docker-run: debug",
      "python": {
        "pathMappings": [
          {
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/app"
          }
        ],
        "projectType": "general"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

和 Dockerfile:

# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.9.6-slim

# Keeps Python from generating .pyc files in …
Run Code Online (Sandbox Code Playgroud)

python docker visual-studio-code

4
推荐指数
1
解决办法
1115
查看次数

标签 统计

docker ×1

python ×1

visual-studio-code ×1