-
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
Having relative paths in .code-workspace files for interpreter path setting doesn't work #11918
Comments
I think you may have set the incorrect path to python. It should be
Also, if you've a common interpreter for all workspace folders, you could just set the workspace setting instead of workspace folder setting. Run the command |
@karrtikr Is Setting But, I tried your suggestion of adding an extra parent reference ("..\..\") and it worked. It wasn't clear that that path was relative to the |
Nope that's not true. You can use any type of settings.
I think you maybe setting the wrong location to pythonPath. Can you try using the absolute path in workspace settings and see if it works? |
Okay, this works but defeats the purpose of having a shared workspace for my team. Using a relative path or using
https://code.visualstudio.com/docs/editor/multi-root-workspaces#_settings "To avoid setting collisions, only resource (file, folder) settings are applied when using a multi-root workspace. Settings which affect the entire editor (for example, UI layout) are ignored." This was my cause for confusion, but it looks like it's referring to the individual workspace settings. |
I am suspecting you may have entered the wrong relative interpreter path, what path did you enter? The workspace settings are saved here I realize docs may not be entirely clear. You can bring that up with https://github.com/microsoft/vscode-docs if you want to. |
I've tried It seems the extension is trying to resolve that path relative to the different roots which is the issue here. |
Can you try using |
It should be |
The unintuitive part to me is that |
Why would you expect that? Remember workspace folder & workspace are separate things. |
See, that is confusing right there. Is it possible for |
I see. Maybe I can help, what exactly is confusing there? Workspace is the
If there's a
|
Okay, here's where our miscommunication stems. |
My bad, you're right. I just tested it out. If there's a For your server folder, it should resolve to |
The correct solution should be to resolve relative paths in |
Yep, you're right. I was missing a layer mentally.
Yes, thanks. |
Feature request from VSCode: microsoft/vscode#98424
Another upstream issue you may relate to microsoft/vscode#77718 Please upvote these if you would like that. |
Closing this issue as pythonPath setting is no longer shareable with this. #12313 |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): Language Serverpython.languageServer
setting: MicrosoftExpected behaviour
I expect this to be able to use a parent virtual environment as the editor's environment. I also tried
${workspaceFolder}/../.venv
. I am trying to use the multi-root workspace feature with a full-stack app scaffold I work with for maintainability in my editor experience.Setting
pythonPath
in the.code-workspace
also seems to have no effect.Actual behaviour
I receive generic extension crash modals and a re-prompt to select my python environment. The crash was intermittent, but it always re-prompts for a python interpreter.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
PowerShell MVP setup script:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: