Python Pyright extension loading problem

Since installing the Python (Pyright) extension from the Cursor team, me and my colleague have a problem.

Sometimes, after working for long in the same session, the Cursor IDE will start to analyze files, but these files will never complete analyzing. Whenever this happens, coloring the code and type checks will be slower.

Seems to b a problem with the type checking, as I don’t have this when I remove the Cursor Pyright extension. This is not present with the native Microsoft extension.

Anybody know how to fix this or know whether this is a bug?

3 Likes

Hi @Jxlle, thanks for sharing this issue. Could you confirm which Python extension and version you’re on (could you share a screenshot of it?). This is the one we recommend:

If it takes a while to index, it might help to add exclude directories (or set include directories) to limit the # of files being indexed. These can be configured in the settings:

Hi @ravirahman,

I have the latest version (1.0.2), but had this problem since installing the first version, as referenced in this post: Cursor Pyright "Python" extension information

The repo I’m using it on is very small.

Hi @Jxlle, thanks for confirming. Does ctrl-click (jump to definition) work?

If so, then it might be an issue with the type check settings, which would affect the colorization. The default is “off” which hides many errors. You might need to be set to “basic” (or a stricter level):

Otherwise, could you share the logs from the “Cursor Pyright” and “basedpyright” output windows? These would be helpful to understand whether the LSP is crashing. Thanks!

Hi @ravirahman,

My type checking settings are on “standard”. Jump to definition works. I already looked at the logs before but couldn’t find anything useful.

Based output:

Python Cursor extension output:

+1, have same error

1 Like

Hi, I’m also on the latest Cursor Pyright version and have the same problem

1 Like

Hi all – thanks for confirming; we are looking into this issue. In the meantime, if you would like to use the VSCode plugin, please first uninstall Python by Anysphere, and then search for “Pylance” and install that. Attaching a screenshot.