Repository navigation
Closed
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
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...
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
Activity
karrtikr commentedon Jun 8, 2022
Hi Andre Riesco (@andreriesco), thanks for reaching out.
Could you provide us the logs as mentioned in the issue template? Set
python.logging.leveltodebugin User settings, reload window, then perform the steps to reproduce before providing the logs.Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)andreriesco commentedon Jun 13, 2022
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
Pythonchannel andPython Test Logchannel.karrtikr commentedon Jun 13, 2022
Hi can you send me a screenshot for the same? Make sure to activate the extension first before opening the Python file?
andreriesco commentedon Jun 13, 2022
Sorry, I forgot to reload the window, now there are logs at the
Pythonchannelstuartthomson commentedon Sep 12, 2022
I am also having this problem.
stuartthomson commentedon Sep 13, 2022
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:
ExtHostTask.$resolveVariablestowin32.findExecutable. The executable it is trying to find is the string"${command:python.interpreterPath}".win32.findExecutable) function. It doesn't check if this exists or not.VariableResolverclass interminalTaskSystem.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.findExecutablefunction 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
karrtikr commentedon Sep 13, 2022
Thanks for digging in,
terminalTaskSystem.tsorwin32.findExecutableutility does not exist within the Python extension, so I think that's coming from VSCode itself.So can you report this at https://github.com/microsoft/vscode instead? If you could identify the issue in the source itself, that would be awesome.
stuartthomson commentedon Sep 14, 2022
A potential solution depending on your use-case is to change the execution type to 'shell' instead of 'process'
karrtikr commentedon Sep 14, 2022
Closing in favor of VSCode issue microsoft/vscode#160891.