0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCodeでuv環境のデバック実行を行うには。

Posted at

おま環の可能性が非常に高いです。

結論

VSCodeでPythonの仮想環境(uv環境)をデバッグ実行する際、launch.jsonファイルに以下の内容を追加します。

launch.json
{
  // IntelliSense を使用して利用可能な属性を学べます。
  // 既存の属性の説明をホバーして表示します。
  // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "app.py",
      "type": "debugpy",
      "request": "launch",
      "program": "${workspaceFolder}/app.py",
      "console": "integratedTerminal",
      "python": "${workspaceFolder}/.venv/Scripts/python.exe",
      "args": "${command:pickArgs}",
      "justMyCode": true
    }
  ]
}

原因

デバッグを行うには、VSCodeが仮想環境内のPythonインタプリタを認識し、適切な設定をlaunch.jsonで指定する必要があります。これにより、VSCodeが仮想環境のPythonインタプリタを使ってデバッグ実行できるようになります。

参考リンク

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?