-
Notifications
You must be signed in to change notification settings - Fork 13
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
Pyright unable to find venv/pythonPath with WSL2 #136
Comments
Are you opening ST4 from within the WSL2 environment? If so, can you open the console with View > Show Console and run the following in the console: |
I guess WSL2 path handling is broken (did that ever work?). I would suggest you open the folder from ST4 started in a regular Windows environment. |
If i open ST4, then menu->file->Open Folder->search a WSL folder from the explorer I get the same exact behaviour. |
I can reproduce this but I didn't work under WSL2. |
Fwiw, I tried this with VSCode + Pyright/Pylance emits the same error. Something like
|
VSCode has this extension https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl which allows you to seamlessy use the linux filesystem. Here some logs from the LSP:
|
Not open sourced so we have no idea what it does. Without its aid, VSCode just emits the same error message. I.e., something like
|
as the docs says:
|
I think this should happen in every non-VSCode editors. Maybe there is already a solution in them (neovim, etc...). |
I am quite sure that the Intellij suite has a similar solution, but unfortunately not open source! |
A path translation algorithm just needs to be aware of all possible combinations of running [ Linux | Windows ] App in [ WSL | Windows ] accessing [ Linux | Windows ] paths. Some inspiration may be taken from https://github.com/SublimeText/WslBuild/blob/ebf26d251d5aeab99f515fca3c5947314c5841aa/plugin.py#L260-L276. Those lines have also found their way into GitGutter, to enable it to use Git for Windows to diff files located within WSL2 filesystem. |
Hello,
I am using SublimeText 4, installed on windows, to open a WSL2 project.
All my venvs are in the proj root dir, in the folder
.venv
(this means thatpython
is at.venv/bin/python
).My pyright settings are the following:
When I open the log panel, what I see is this:
Is there any way to make Pyright aware of the WSL mount and resolve the paths correctly?
The text was updated successfully, but these errors were encountered: