@ravirahman I want to say that I support Cursor, but Cursor pyright doesn’t work as well as Pylance. Those import directives are completely ineffective. When can Cursor properly address this extension issue, and at least not have so many annoying exception prompts?
Thanks for the feedback. Do the prompts keep on appearing? We added them in to help with the migration.
Regarding the import directives, do they work if you put them in a pyproject.toml file under the [tool.pyright] section, or a pyrightconfig.json file?
Just wanted to come here to +1 this thread. recently updated cursor and pylance blew up and couldn’t get it back. spent a whole day on this and even reinstalled macos. Was not able to get pylance back and working. Cursor Python (based pyright fork from Anytype) was completely unusable for both work and personal python projects due to an insane quantity of false positive linter errors.
For turning Cursorpyright > Analysis: Type Checking Mode form basic > off fixed things, but this was a MASSIVE headache.
You should really allow Pylance or the cursorpyright needs to mature significantly.
I had that already, but the issue is that now I don’t get any warning errors if I, for instance, didn’t import a library. I tried installing django stubs and such, both with pyright and mypy but it’s just a mess and couldn’t get them to work properly.
With pylance everything works out of the box, it can infer most django types (not all though, but at least I can have the most critical checks in place).
I guess pylance is no longer available in the Extensions marketplace since Cursor switched to the OpenVSX marketplace.
But there’s a workaround to use pylance in Cursor:
There are 2 steps to this:
Bring back Microsoft’s extensions
Even with pylance installed, it won’t work due to Microsoft’s checks on the IDE you’re using inside the pylance extension. In other words, it will check if you’re using VSCode, and if not, it won’t activate the extension.
Note that this was a hassle to implement and, though it works, I agree with the peeps that say we should start using basedpyright as it has most of pylance functionality, it’s open source and doesn’t collect your data.
First, you need to bring back the VSCode marketplace
Go to the settings @ravirahman said: Hit F1 → Open VSCode Settings → Features → Extensions
Then find Gallery: Item Url and Gallery: Service Url:
For “Gallery: Item Url” input this Url: https://marketplace.visualstudio.com/items
For “Gallery: Service Url” input this Url: https://marketplace.visualstudio.com/_apis/public/gallery
It’s not their choice, Microsoft doesn’t allow the use of pylance on any software that is not theirs. Try my workaround below or install basedpyright which is the most similar to pylance and it’s open source