Skip to content

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

Closed

Description

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...

Activity

  1. added
    triage-needed
    on Jun 8, 2022
  2. karrtikr commented on Jun 8, 2022

    @karrtikr

    Hi Andre Riesco (@andreriesco), thanks for reaching out.

    Could you provide us the logs as mentioned in the issue template? Set python.logging.level to debug in User settings, reload window, then perform the steps to reproduce before providing the logs.

    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

  3. added
    info-needed
    on Jun 8, 2022
  4. added
    bug
    area-environments
    on Jun 9, 2022
  5. andreriesco commented on Jun 13, 2022

    @andreriesco
    Author

    Hello Kartik Raj (@karrtikr),
    Thanks for the reply. I changed the python logging level to debug in the user configurations and tried to execute the code and nothing was printed on both Python channel and Python Test Log channel.

  6. karrtikr commented on Jun 13, 2022

    @karrtikr

    Hi can you send me a screenshot for the same? Make sure to activate the extension first before opening the Python file?

  7. andreriesco commented on Jun 13, 2022

    @andreriesco
    Author

    Sorry, I forgot to reload the window, now there are logs at the Python channel

    Experiment 'pythonaacf' is active
    Experiment 'pythonTensorboardExperiment' is active
    Experiment 'PythonPyTorchProfiler' is active
    [DEBUG 2022-5-13 21:35:38.712]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.717]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.717]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.724]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.725]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.726]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.729]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.729]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:38.761]: Testing: Setting up watcher for c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui
    LSP Notebooks experiment is disabled -- not in treatment group
    [DEBUG 2022-5-13 21:35:38.771]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    Python interpreter path: ~\AppData\Local\Microsoft\WindowsApps\python3.8.exe
    [INFO 2022-5-13 21:35:39.411]: [
      'Display locator refreshing progress, Class name = g, completed in 0ms, has a falsy return value, , Return Value: undefined'
    ]
    [DEBUG 2022-5-13 21:35:39.412]: Searching for conda.
    [DEBUG 2022-5-13 21:35:39.459]: Probing conda binary: conda
    > conda info --json
    [DEBUG 2022-5-13 21:35:40.561]: Failed to spawn conda binary conda [Error: spawn conda ENOENT
    	at Process.onexit (node:internal/child_process:282:19)
    	at onErrorNT (node:internal/child_process:477:16)
    	at processTicksAndRejections (node:internal/process/task_queues:83:21)] {
      errno: -4058,
      code: 'ENOENT',
      syscall: 'spawn conda',
      path: 'conda',
      spawnargs: [ 'info', '--json' ]
    }
    [DEBUG 2022-5-13 21:35:40.564]: Searching for workspace virtual envs in: c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui
    [DEBUG 2022-5-13 21:35:40.565]: Getting roots
    [DEBUG 2022-5-13 21:35:40.565]: Found roots
    [DEBUG 2022-5-13 21:35:41.446]: Cached data exists getEnvironmentVariables, <No Resource>
    > ~\AppData\Local\Microsoft\WindowsApps\python3.8.exe ~\.vscode\extensions\ms-python.python-2022.8.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2022.8.0\pythonFiles\interpreterInfo.py
    [DEBUG 2022-5-13 21:35:47.111]: Cached data exists KeyPrefix=Cache_Method_Output_S.ensureEnvironmentContainsPython-Args="C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe"
    [INFO 2022-5-13 21:35:47.131]: Found interpreter for C:\Users\andre.riesco\AppData\Local\Microsoft\WindowsApps\python3.8.exe,c:\Users\andre.riesco\.vscode\extensions\ms-python.python-2022.8.0\pythonFiles\get_output_via_markers.py,c:\Users\andre.riesco\.vscode\extensions\ms-python.python-2022.8.0\pythonFiles\interpreterInfo.py
    [DEBUG 2022-5-13 21:35:47.161]: Getting roots
    [DEBUG 2022-5-13 21:35:47.179]: Found roots
    [DEBUG 2022-5-13 21:35:47.180]: Start watching root c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui for globs ["python.exe","*/python.exe","*/Scripts/python.exe"]
    [DEBUG 2022-5-13 21:35:47.180]: Start watching: c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui with pattern python.exe using VSCode API
    [DEBUG 2022-5-13 21:35:47.182]: Start watching: c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui with pattern */python.exe using VSCode API
    [DEBUG 2022-5-13 21:35:47.182]: Start watching: c:\Users\andre.riesco\Documents\IDEextension\tests\testpyui with pattern */Scripts/python.exe using VSCode API
    [DEBUG 2022-5-13 21:35:52.885]: Cached data exists KeyPrefix=Cache_Method_Output_S.ensureEnvironmentContainsPython-Args="C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe"
    [DEBUG 2022-5-13 21:35:52.921]: Shell path 'Torizon IDE backend process', base path 'Torizon IDE backend process'
    [DEBUG 2022-5-13 21:35:52.921]: Shell path identified as shell 'other'
    [DEBUG 2022-5-13 21:35:52.922]: Terminal name 'Torizon IDE backend process' identified as shell 'other'
    [DEBUG 2022-5-13 21:35:52.922]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:52.926]: Shell path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses.exe', base path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses'
    [DEBUG 2022-5-13 21:35:52.927]: Shell path identified as shell 'other'
    [DEBUG 2022-5-13 21:35:52.927]: Terminal shell path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses.exe' identified as shell 'other'
    [DEBUG 2022-5-13 21:35:52.927]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:52.928]: Shell path from user settings 'null'
    [DEBUG 2022-5-13 21:35:52.928]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:52.930]: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe', base path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell'
    [DEBUG 2022-5-13 21:35:52.930]: Shell path identified as shell 'powershell'
    [DEBUG 2022-5-13 21:35:52.932]: Shell path from user env 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
    [DEBUG 2022-5-13 21:35:52.932]: [object Object]. Shell identified as powershell (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:52.935]: Shell identified as 'powershell'
    [DEBUG 2022-5-13 21:35:53.545]: Couldn't locate the conda binary.
    [DEBUG 2022-5-13 21:35:53.545]: Couldn't locate the conda binary.
    [INFO 2022-5-13 21:35:53.553]: Environments added to cache [{"name":"","location":"","kind":"global-windows-store","executable":{"filename":"C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe","sysPrefix":"C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0","ctime":1654560088290,"mtime":1654560088290},"display":"Python 3.8.10 64-bit (windows store)","version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]"},"arch":3,"distro":{"org":"Microsoft"},"source":["path env var"],"id":"C:\\USERS\\ANDRE.RIESCO\\APPDATA\\LOCAL\\MICROSOFT\\WINDOWSAPPS\\PYTHON3.8.EXE","detailedDisplayName":"Python 3.8.10 64-bit (windows store)"}]
    [INFO 2022-5-13 21:35:53.555]: [
      'Hide locator refreshing progress, Class name = g, completed in 0ms, has a falsy return value, , Return Value: undefined'
    ]
    [DEBUG 2022-5-13 21:35:53.558]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.561]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.562]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.566]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.571]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.572]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.579]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.579]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.582]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.588]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.589]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:53.926]: Activation Commands received undefined for shell cmd
    [INFO 2022-5-13 21:35:53.928]: [
      'getActivatedEnvironmentVariables, Class name = I, completed in 14392ms, has a falsy return value, Arg 1: undefined, Arg 2: {"id":"C:\\\\USERS\\\\ANDRE.RIESCO\\\\APPDATA\\\\LOCAL\\\\MICROSOFT\\\\WINDOWSAPPS\\\\PYTHON3.8.EXE","sysPrefix":"C:\\\\Program Files\\\\WindowsApps\\\\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0","envType":"WindowsStore","envName":"","architecture":3,"sysVersion":"3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]","version":{"raw":"3.8.10","major":3,"minor":8,"patch":10,"build":[],"prerelease":["final","0"]},"companyDisplayName":"Microsoft","displayName":"Python 3.8.10 64-bit (windows store)","detailedDisplayName":"Python 3.8.10 64-bit (windows store)","path":"c:\\\\Users\\\\andre.riesco\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps\\\\python3.8.exe"}, Arg 3: false'
    ]
    [DEBUG 2022-5-13 21:35:54.630]: Shell path 'Torizon IDE backend process', base path 'Torizon IDE backend process'
    [DEBUG 2022-5-13 21:35:54.630]: Shell path identified as shell 'other'
    [DEBUG 2022-5-13 21:35:54.630]: Terminal name 'Torizon IDE backend process' identified as shell 'other'
    [DEBUG 2022-5-13 21:35:54.630]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:54.630]: Shell path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses.exe', base path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses'
    [DEBUG 2022-5-13 21:35:54.630]: Shell path identified as shell 'other'
    [DEBUG 2022-5-13 21:35:54.630]: Terminal shell path 'c:\Users\andre.riesco\Documents\IDEextension\repositories\main\vs-code-plugin\torizon\moses-windows\moses.exe' identified as shell 'other'
    [DEBUG 2022-5-13 21:35:54.630]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:54.631]: Shell path from user settings 'null'
    [DEBUG 2022-5-13 21:35:54.631]: [object Object]. Shell identified as other (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:54.631]: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe', base path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell'
    [DEBUG 2022-5-13 21:35:54.631]: Shell path identified as shell 'powershell'
    [DEBUG 2022-5-13 21:35:54.631]: Shell path from user env 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
    [DEBUG 2022-5-13 21:35:54.631]: [object Object]. Shell identified as powershell (Terminal name is Torizon IDE backend process)
    [DEBUG 2022-5-13 21:35:54.632]: Shell identified as 'powershell'
    [DEBUG 2022-5-13 21:35:54.850]: Delay Trigger[Test Configuration Change]: triggered=1, called=1
    [INFO 2022-5-13 21:35:56.30]: [
      'Starting language server, Class name = d, completed in 2166ms, has a falsy return value, , Return Value: undefined'
    ]
    Starting Pylance language server.
    [DEBUG 2022-5-13 21:35:56.38]: [object Object]. Shell identified as undefined 
    [DEBUG 2022-5-13 21:35:56.38]: Shell path 'C:\Program Files\PowerShell\7\pwsh.exe', base path 'C:\Program Files\PowerShell\7\pwsh'
    [DEBUG 2022-5-13 21:35:56.38]: Shell path identified as shell 'powershellCore'
    [DEBUG 2022-5-13 21:35:56.38]: Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore'
    [DEBUG 2022-5-13 21:35:56.38]: [object Object]. Shell identified as powershellCore 
    [DEBUG 2022-5-13 21:35:56.39]: Shell identified as 'powershellCore'
    [DEBUG 2022-5-13 21:35:56.41]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:56.41]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_C:\\USERS\\ANDRE.RIESCO\\DOCUMENTS\\IDEEXTENSION\\TESTS\\TESTPYUI"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:35:56.42]: Cached data exists KeyPrefix=Cache_Method_Output_h.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-c:\\Users\\andre.riesco\\Documents\\IDEextension\\tests\\testpyui"-Arg-Separator-undefined
    [DEBUG 2022-5-13 21:36:22.371]: Cached data exists KeyPrefix=Cache_Method_Output_S.ensureEnvironmentContainsPython-Args="C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe"
    [DEBUG 2022-5-13 21:36:25.453]: Cached data exists KeyPrefix=Cache_Method_Output_S.ensureEnvironmentContainsPython-Args="C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe"
    [DEBUG 2022-5-13 21:36:44.315]: Cached data exists KeyPrefix=Cache_Method_Output_S.ensureEnvironmentContainsPython-Args="C:\\Users\\andre.riesco\\AppData\\Local\\Microsoft\\WindowsApps\\python3.8.exe"
    
  8. added
    reports-wanted
    on Jul 7, 2022
  9. stuartthomson commented on Sep 12, 2022

    @stuartthomson

    I am also having this problem.

  10. stuartthomson commented on Sep 13, 2022

    @stuartthomson

    I've been looking into this a bit and I think I might know why it's happening. Apologies if this is hard to follow:

    • There is a call in ExtHostTask.$resolveVariables to win32.findExecutable. The executable it is trying to find is the string "${command:python.interpreterPath}".
    • It doesn't think this looks like an absolute path, so it prepends it with the current working directory (see the very end of the win32.findExecutable) function. It doesn't check if this exists or not.
    • Later on, there is further variable resolution done by the VariableResolver class in terminalTaskSystem.ts. This resolver has the details needed to expand the interpreter path correctly, but it has already been prepended with the cwd.

    Proposed Solutions

    • Perhaps the win32.findExecutable function could check if the executable exists at the location, and if it doesn't, simple return the unaltered process name (in this case "${command:python.interpreterPath}")?

    • Alternatively, perhaps this call could be somehow removed from the setup done in ExtHostTask?

    • Perhaps the path could be resolved before running it - if there are two absolute paths then

  11. karrtikr commented on Sep 13, 2022

    @karrtikr
  12. removed
    reports-wanted
    on Sep 13, 2022
  13. stuartthomson commented on Sep 14, 2022

    @stuartthomson

    A potential solution depending on your use-case is to change the execution type to 'shell' instead of 'process'

  14. karrtikr commented on Sep 14, 2022

    @karrtikr

    Closing in favor of VSCode issue microsoft/vscode#160891.

  15. locked as resolved and limited conversation to collaborators on Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsbuginfo-neededtriage-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions