Skip to content

${command:python.interpreterPath} returning ${workspace}:(pythonDefaultInterpreterPath) instead of just (pythonDefaultInterpreterPath) #19265

@andreriesco

Description

@andreriesco

I believe this issue is similar to the ones reported on #16568 #17076

VS Code:

Version: 1.67.2 (user setup)
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:15:52.058Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.22000

Python extension:

Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), Jupyter Notebooks, code formatting, refactoring, unit tests, and more.
Version: v2022.6.3
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "${command:python.interpreterPath}",
            "type": "process",
            "args": [
                "${workspaceFolder}/.helpers/_build_ui_files.py",
                "${workspaceFolder}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Default interpreter path:
~\AppData\Local\Microsoft\WindowsApps\python3.8.exe

Task output:

> Executing task: C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui\C:\Users\andre.riesco\AppData\Local\Microsoft\WindowsApps\python3.8.exe C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui/.helpers/_build_ui_files.py C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui <

The terminal process failed to launch: Path to shell executable "C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui\C:\Users\andre.riesco\AppData\Local\Microsoft\WindowsApps\python3.8.exe" does not exist.

But when I change the "command:" parameter to "python3", as in the "tasks.json" below:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build",
            "command": "python3",
            "type": "process",
            "args": [
                "${workspaceFolder}/.helpers/_build_ui_files.py",
                "${workspaceFolder}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

It works. Output:

> Executing task: C:\Users\andre.riesco\AppData\Local\Microsoft\WindowsApps\python3.exe C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui/.helpers/_build_ui_files.py C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui <
Using pyside2-uic version  uic 5.15.2
Processing C:\Users\andre.riesco\Documents\IDEextension\tests\testpyui\mainwindow.ui...

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions