vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

[Bug] Python code using bad interpreter path on Windows (`/usr/bin/python3`)

Open Phrogz opened this issue 1 year ago • 1 comments

  • VS Code Version: 1.83.1
  • OS Version: Windows 10
  • Code Runner Version: 0.12.1

Describe the bug Run code with a Python file open attempts to run /usr/bin/python3 which does not exist.

User settings include the following, but are not being used:

    "python.defaultInterpreterPath": "C:\\Users\\gkistner\\AppData\\Local\\Programs\\Python\\Python312\\python.EXE"
    "code-runner.executorMap": {
        "python": "python -u",
        "python3": "python -u",
    }

Environment PATH variable includes the path to the executable (both user and system environment variables).

To Reproduce Steps to reproduce the behavior:

  1. Open file with .py extension
  2. Issue Run Code command

Actual behavior

[Running] /usr/bin/python3 "c:\Users\gkistner\Downloads\google-python-exercises\hello.py"
The system cannot find the path specified.

[Done] exited with code=1 in 0.095 seconds

Expected behavior Correct or configured file path is used.

Phrogz avatar Oct 30 '23 20:10 Phrogz

在 setting.json 增加以下配置:

"code-runner.respectShebang": false

peytonyip avatar Nov 08 '23 13:11 peytonyip