microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
39 stars 17 forks source link

"Debug and Run" Button doesn't recognize predefined interpreter in settings.json and selects a different one #363

Open atheo89 opened 2 weeks ago

atheo89 commented 2 weeks ago

Description

"Debug and Run" Button doesn't recognize predefined interpreter in settings.json and selects a different one, in contrary the Run icon on top left on the screen works as expected.

OS/Web Information

Steps to Reproduce

  1. Launch code server
  2. Install ms-python extension
  3. Set on settings.json your preferred interpreter "python.defaultInterpreterPath": "/path/to/different/interpreter"
  4. Reload Window
  5. Create a test python file
  6. Press Run > icon on the top right. It will run your file without issue using the predefined interpreter.
  7. Now press on Run and Debug and see on the bottom right banner the in the python section use a different interpreter from the one that we pre defined.

Expected

The "Run and Debug" button to use the python interpreter that is been defined on the settings.json file by the user.

paulacamargo25 commented 2 weeks ago

Thanks for the bug report, I'll try to reproduce it. Could you confirm that you don't have a launch config in launch.json or in settings.json. And could you also send me the value of your interpreter path in the Python Extension? (you can find it in the right bottom corner)

atheo89 commented 1 week ago

Hi, thank you for your patience on the reply!

I only use settings.json file to set up the desired interpreter, I don't have launch.json

Here’s the configuration:

{
  "python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}

I have the same interpreter path in the Python Extension.

paulacamargo25 commented 5 days ago

Thanks for your reply, i'll try to repro the issue :)