Skip to content

${command:python.interpreterPath} in tasks.json when in pythonDeprecatePythonPath experiment #16568

Closed

Description

@jeremyd2019

Environment data

  • VS Code version: 1.57.1
  • Extension version (available under the Extensions sidebar): 2021.6.944021595
  • OS and version: Windows 10 20H2
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.8.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Value of the python.languageServer setting: Pylance

Expected behaviour

The following tasks work:

        {
            "label": "pywxrc",
            "type": "process",
            "command": "${command:python.interpreterPath}",
            "options": {
                "cwd": "${workspaceRoot}"
            },
            "args": ["-m", "wx.tools.pywxrc", "-p", "-g", "-e", "-v", "-o", "rdgui_xrc.py", "rdgui.xrc"],
            "problemMatcher": [],
            "group": "build",
            "dependsOn": ["clean pywxrc"]
        },
        {
            "label": "clean pywxrc",
            "type": "shell",
            "command": "rm",
            "windows": {
                "command": "del",
            },
            "options": {
                "cwd": "${workspaceRoot}"
            },
            "args": ["rdgui_xrc.py"],
            "problemMatcher": []
        }

Actual behaviour

> Executing task: D:\path\to\workspace\d:\path\to\venv\Scripts\python.exe -m wx.tools.pywxrc -p -g -e -v -o rdgui_xrc.py rdgui.xrc <

The terminal process failed to launch: Path to shell executable "D:\path\to\workspace\d:\path\to\venv\Scripts\python.exe" does not exist.

Logs

Output for Python in the Output panel

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'pythonDeprecatePythonPath'
Python interpreter path: C:\Python38\python.exe
Python interpreter path: d:\path\to\venv\Scripts\python.exe
Starting Pylance language server.
> d:\path\to\venv\Scripts\python.exe -m pylint --extension-pkg-whitelist=wx --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text d:\path\to\workspace\config.py
cwd: d:\path\to\workspace
> d:\path\to\venv\Scripts\python.exe -m pylint --extension-pkg-whitelist=wx --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode,E0001,E0011,E0012,E0100,E0101,E0102,E0103,E0104,E0105,E0107,E0108,E0110,E0111,E0112,E0113,E0114,E0115,E0116,E0117,E0118,E0202,E0203,E0211,E0213,E0236,E0237,E0238,E0239,E0240,E0241,E0301,E0302,E0303,E0401,E0402,E0601,E0602,E0603,E0604,E0611,E0632,E0633,E0701,E0702,E0703,E0704,E0710,E0711,E0712,E1003,E1101,E1102,E1111,E1120,E1121,E1123,E1124,E1125,E1126,E1127,E1128,E1129,E1130,E1131,E1132,E1133,E1134,E1135,E1136,E1137,E1138,E1139,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,E1700,E1701 --msg-template='{line},{column},{category},{symbol}:{msg}' --reports=n --output-format=text d:\path\to\workspace\config.py
cwd: d:\path\to\workspace
##########Linting Output - pylint##########
> conda --version

Activity

  1. added
    triage-needed
    bug
    on Jun 26, 2021
  2. changed the title [-]${command:pythonInterpreterPath} [/-] [+]${command:pythonInterpreterPath} in tasks.json[/+] on Jun 27, 2021
  3. changed the title [-]${command:pythonInterpreterPath} in tasks.json[/-] [+]${command:python.InterpreterPath} in tasks.json[/+] on Jun 27, 2021
  4. changed the title [-]${command:python.InterpreterPath} in tasks.json[/-] [+]${command:python.interpreterPath} in tasks.json[/+] on Jun 27, 2021
  5. added and removed
    triage-needed
    on Jun 28, 2021
  6. eleanorjboyd commented on Jun 28, 2021

    @eleanorjboyd

    Hello,

    • Can you please provide the following settings; python.pythonPath and python.defaultInterpreterPath?
    • Is your venv inside the workspace folder?
    • Can you try to use relative path instead of absolute path in the setting? That would mean that instead of d:\path\to\venv\Scripts\python.exe, try using the path which is local to workspace.
  7. jeremyd2019 commented on Jun 28, 2021

    @jeremyd2019
    Author
    "python.pythonPath": "C:\\Python38\\python.exe",
    "python.defaultInterpreterPath": "C:\\Python38\\python.exe",
    

    The output from the python output channel is included in the collapsing details/summary section

  8. jeremyd2019 commented on Jun 28, 2021

    @jeremyd2019
    Author

    My venv is not inside the workspace folder. I tried selecting python interpreter in the UI (since it doesn't store that in settings anymore but in workspace storage I don't know how to edit manually) and typing in ..\venv\Scripts\python.exe, but got the same results.

  9. jeremyd2019 commented on Jun 28, 2021

    @jeremyd2019
    Author

    This worked fine before I got in this experiment, and changed my tasks.json from ${config:python.pythonPath} to ${command:python.interpreterPath}

  10. changed the title [-]${command:python.interpreterPath} in tasks.json[/-] [+]${command:python.interpreterPath} in tasks.json when in `pythonDeprecatePython` experiment[/+] on Jun 28, 2021
  11. changed the title [-]${command:python.interpreterPath} in tasks.json when in `pythonDeprecatePython` experiment[/-] [+]${command:python.interpreterPath} in tasks.json when in `pythonDeprecatePythonPath` experiment[/+] on Jun 28, 2021
  12. added
    important
    on Jun 28, 2021
  13. karrtikr commented on Jun 28, 2021

    @karrtikr

    I see, while we try to reproduce this, you can temporarily opt out of this experiment by following the instructions in the wiki.

  14. removed
    important
    on Jul 12, 2021
  15. brettcannon commented on Jul 12, 2021

    @brettcannon
    Member

    We were not able to reproduce the issue, which means we can't unfortunately attempt to fix it since we can't get it to fail in the first place.

    We are going to pre-emptively close this issue, but if the issue continues and you can come up with very specific reproduction steps (like a test repo with the appropriate settings and a step-by-step guide of what to do once the test repo is opened) we would be happy to try to reproduce it again.

  16. jeremyd2019 commented on Jul 16, 2021

    @jeremyd2019
    Author

    OK, I've opted out of the experiment and reverted to using ${config:python.pythonPath}, and it's working fine now.

  17. Artalus commented on Aug 18, 2021

    @Artalus

    Got the same issue.

    VS Code:

    Version: 1.59.0 (system setup)
    Commit: 379476f0e13988d90fab105c5c19e7abc8b1dea8
    Date: 2021-08-04T23:13:12.822Z
    Electron: 13.1.7
    Chrome: 91.0.4472.124
    Node.js: 14.16.0
    V8: 9.1.269.36-electron.0
    OS: Windows_NT x64 10.0.17763
    

    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: 2021.8.1105858891
    Publisher: Microsoft
    VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
    

    tasks.json:

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
            {
                "label": "doit",
                "type": "process",
                "command": "${command:python.interpreterPath}",
                "args": [
                    "py.py"
                ],
                "problemMatcher": []
            }
        ]
    }
    

    Default interpreter:
    image

    Task output:

    > Executing task: R:\py\C:\Python\39\python.exe py.py <
    The terminal process failed to launch: Path to shell executable "R:\py\C:\Python\39\python.exe" does not exist.
    

    Initially I got the same issue in the folder where I had virtualenv in a subfolder:

    > Executing task: S:\git\Jenot\s:\git\Jenot\venv\Scripts\python.exe -m doit <
    The terminal process failed to launch: Path to shell executable "S:\git\Jenot\s:\git\Jenot\venv\Scripts\python.exe" does not exist.
    

    VS Code in there uses a relative path ro interpreter for some reason:
    image

  18. brettcannon commented on Aug 23, 2021

    @brettcannon
    Member

    Artalus can you please open a new issue?

  19. locked as resolved and limited conversation to collaborators on Sep 23, 2021
  20. removed their assignment
    on Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions