-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python.defaultInterpreterPath fails to resolve when using both ${workspaceFolder:name}
and relative paths
#22568
Comments
After searching through a lot of other tickets, I eventually tried a "Clear Workspace Interpreter Setting" > "Clear all" (not "Clear at workspace level", and then redid the "Select Interpreter" > "Select at workspace level" > "Use Python from 'python.defaultInterpreterPath' setting". That seemed to miraculously fix everything, and opening files in multiple workspace folders no longer prompts me to select an interpreter. So I guess now this is a report that maybe that internal storage can get in a bad state that selecting the interpreter that way does not fix. |
Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience! |
@nrs-mparker This was it for me as well! After scouring all the issues and documentation, this was the only thing that finally got my It made debugging the VSCode workspace settings super difficult because you don't know if the setting is actually wrong, or of this clear operation needs to be triggered first. @karrtikr Any idea where this "Clear Workspace Interpreter Setting" is caching that setting? An more importantly, why is it caching it at all and not just honoring whatever is defined in |
@walsha2 If you hover over the setting, we have a description stating how it works: The primary purpose of |
@nrs-mparker Appreciate your diagnosis, let us know if you run into such a bad state again and we'll be happy to reopen the issue and take a look:
But even so, this error being a warning should not ideally affect the behavior. If you still face an issue, please provide the debug logs which can help diagnose the issue:
Output for
|
@karrtikr I have not encountered the issue again since my post, but I will be sure to do that if it reoccurs. But I do want to say that even though the output is only a warning, the real loss of functionality is in not having an interpreter selected and not being able to select the intended one. A user basically can't use the program in that state, though readers of this thread will see the workaround. I just provided that output in case it indicated to you or anyone else what the cause might be. Perhaps the next person to encounter this can set their logs to be verbose and reload before clearing out the interpreter settings. |
Type: Bug
Behaviour
Expected vs. Actual
I'm trying to make a multi-root workspace for an Unreal Engine project that has Python in many different folders, and I've specified the paths to all of them as relative paths from the .code-workspace file. Unreal ships with its own copy of the interpreter, so all roots should use that same one. However, if I use
workspaceFolder:name
and a relative path from there, defaultInterpreterPath fails to resolve it and repeatedly prompts me to select a new interpreter. Here's a relevant snippet of the file:Everything about the workspace functions well on my and another person's machine except the interpreter path. When I try to pick that one as the interpreter, I get:
The workspace and all code files are not even on the C: drive, so it's clear that it's starting from something like where VS Code or the Python extension are installed instead. I've tried changing the workspaceFolders themselves to be absolute and got the same result, so expanding that doesn't seem to be the problem.
Expected: The interpreter path is resolved correctly and recognized as a valid interpreter.
Actual: The interpreter path is not resolved correctly, so no interpreter is found at that location.
Seems to be related to/part of #22452
Steps to reproduce:
"python.defaultInterpreterPath": "${workspaceFolder:named-folder}/../../python.exe"
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.21.13331008
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: