Pylance not working despite python.languageServer set to “Pylance”
Steps to Reproduce
In .vscode/settings.json, I set:
{
"python.languageServer": "Pylance"
}
However, the Pylance extension is not installed. VSCode shows this prompt:
"The Pylance extension is not installed but the python.languageServer value is set to 'Pylance'. Would you like to install the Pylance extension to use Pylance, or revert back to Jedi?"
As a result, Python Quick Fix (like import suggestions) does not work at all.
Expected:
VSCode should either fallback gracefully or clearly indicate that Pylance is required for Quick Fix features.
Tested on:
Cursor IDE 1.2.1
Python extension installed
### Operating System
Linux
### Current Cursor Version (Menu -> About Cursor -> Copy)
Cursor : 1.2.1
VSCode Version: 1.99.3
### Does this stop you from using Cursor
No - Cursor works, but with this issue
Hi @yunjinchoidev, Pylance is not supported within Cursor. Could you try setting this to “none”, which will allow the Anysphere Python extension to provide the LSP? We don’t support the same quick actions as Pylance – I’d recommend to ask the agent to perform the task if you can’t find an action that you’re looking for.
A month ago, Quick Fix (like auto-import suggestions) was working just fine in Cursor without needing the Pylance extension. I haven’t changed any settings since then, but now it’s suddenly broken. Did something change recently that might have caused this?
thanks a lot for the clarification and all the work you’re doing on Cursor.
I just wanted to share that for me (and probably many other developers), Quick Fix features like auto-import suggestions are an essential part of daily development.
It used to work well in Cursor, and I really appreciated that convenience. But with the recent changes, it’s now broken, and that’s been a noticeable hit to my productivity.
I truly hope you consider either supporting Pylance or enhancing the Anysphere extension to bring back full Quick Fix support.
I really enjoy using Cursor and would love to keep using it as my main IDE — but this feature feels like a must-have, not a nice-to-have.
Thanks again for your time and continued improvements!
Hi @yunjinchoidev, Quick fix for auto-import is supported. If its not showing up, then the language server might not be configured properly. Does jump-to-definition work, and do you see any errors from the language server? If not, please make sure a Python interpreter is selected.
Jump-to-definition works once the import is resolved, so that part seems fine. However, when I try to run “Restart Language Server”, I get the error: command 'python.analysis.restartLanguageServer' not found.
I believe this is because my settings.json has "python.languageServer": "None".
When I switch to "Pylance", I get a “revert” error (not sure why).
The Python interpreter is correctly selected, though.
If jump-to-definition is working, then this is likely because of differences in how the auto-import is implemented (especially with aliases or nested imports). Is Cursor Tab able to complete the imports?
You can use the command cursorpyright.restartserver to restart the server; we require that python.languageServer be “None” so that Cursor Python language server can activate.
Thanks for the explanation. Just to clarify — auto-import does work when using the Cursor tab (I can complete imports there), but when I press Cmd + ., I only see the “Fix with AI” option. The list of available imports doesn’t appear like it usually does with Quick Fix.
This has been a breaking change for ssh as far as I can tell and has basically made me abandon Cursor for that use case. I don’t think anysphere is getting set up properly on all instances; it breaks like in this thread if not much worse (incorrect unreachable code, etc). Are you saying that I need to create this attribute to set to None explicitly in the command line or editor, that flow seems broken. Maybe I am misunderstanding though.
Is this attribute setting not automated, or overwritten automatically if existing in another state Cursor doesn’t support?
it breaks like in this thread if not much worse (incorrect unreachable code, etc).
For this problem, could you upgrade to version 1.0.6 of the Anysphere Python extension? We adjusted the error / warning defaults to they are more similar to Pylance / VSCode. Could you try upgrading the extension?
This seemed to fix a lot of the blatant breaking changes, thanks. I can now select interpreter, use Intellisense, don’t get a bunch of fictitious errors, etc.
There’s still an issue I observe which is fictitious unreachable code. I’m not really sure how to minimally reproduce this but it only happened upon the switch. Usually this sort of thing is very obvuiously the result of code after a “return” or “pass” etc. Happening after a subtraction operation seems really arbitrary.