-
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
pyright language server crashes when run from inside venv created by uv #6399
Comments
Thanks, that's really strange. @dhruvmanila, would you have any ideas here? |
Interesting, not sure. I'd need to look |
Installing |
sorry i shouldve updated the issue. pyprojectx is not required to reproduce the issue, i included those steps just in case but a colleague was able to reproduce the issue by installing uv normally. i should also mention that i can't reproduce those ruff errors anymore, only the basedpyright errors. |
So, should the steps be the following?
It's working fine on MacOS at least, let me (or ask someone) try it on a Windows machine. |
hmm this is very odd, i can't seem to reproduce the issue anymore. i'll just close this issue for now and i will investigate further and reopen it once i have more info. sorry to waste your time |
nevermind it does still happen with those steps, i just forgot to restart vscode so it was using the version of basedpyright bundled with the extension instead of the one in the venv. |
also reproduced with the pyright pypi package
|
so i tried to investigate this further on my end and came to the conclusion that it's something to do with the i also found that passing |
i'm not sure what's causing this, but for some reason all of my language servers are crashing with strange errors when running from a venv created by uv (tested with both ruff and basedpyright language servers).
to reproduce
install uv using pyprojectx:
./pw uv add ruff
./pw uv add basedpyright==1.17.0
(i added a workaround in a later release, see comment below)install the ruff and basedpyright vscode extensions
set the python interpreter (F1 > "Python: Select Interpreter" > ".venv")
restart vscode (probably not necessary but just in case)
click the Output tab in the terminal and select "Ruff" from the dropdown
my venv does include the
pyvenv.cfg
file so i don't know why that error is occurring:check the basedpyright output:
environment info
windows 11, python 3.12, vscode 1.92.2, uv 0.3.1, ruff 0.6.1
The text was updated successfully, but these errors were encountered: