Skip to content

Frequently asked questions#

My code should have no/these errors, but it does/doesn't.#

This plugin contains no type checking logic. For type checking bugs, please report them to the Pyright issue tracker.

What's the difference between the pyright and pyright-python files?#

Pyright is written in TypeScript and officially published on NPM. It requires a dependency on Node, which Python developers might not have on their development machines.

The PyPI pyright package was created to solve this problem. When installed, it places 4 proxy executables in the same virtual environment/directory you have your pip in:

  • pyright/pyright-langserver (these have the same names as the originals)
  • pyright-python/pyright-python-langserver

These proxies will automatically install the actual NPM package if it is not already installed, then re-output the results of the original executables. With the correct configurations, new versions may be automatically installed at runtime.

If the corresponding version of the NPM package has not been installed, the proxies will also re-output the "added 1 package" notice by NPM, which will cause parsing errors. Due to this, it is recommended that the original executables are used instead.

Said original executables can typically be found at:

  • Windows: %HOMEPATH%/.cache/pyright-python/<version>/node_modules/.bin
  • Linux: ~/.cache/pyright-python/<version>/node_modules/.bin

Why does the plugin have to perform saves so often in command line mode?#

Pyright only reads actual files on disk. It does not support passing files from stdin. A feature request was made and quickly rejected.

Adding an option that makes the plugin run only on "manual" saves (the Save All action) is counter-productive, since that doesn't guarantee the annotator class is called. This is a known limitation.

Use one of the two other modes instead.

Is the command-line watch mode (--watch) supported?#

No. Use one of the two language server modes instead.

What does this command line option do?#

Refer to Pyright's documentation for the meaning of these options.

Is this plugin affiliated with Microsoft/JetBrains?#

No, or at least not in a business or ownership sense.

It was, however, created out of adoration of Pyright and JetBrains IDEs.

Does this plugin support Basedpyright?#

Only in Command line mode. See this issue for more information.

I love this project. How can I support it?#

You can consider sponsoring it.

If you are feeling generous, see CONTRIBUTING.md for how to contribute non-financially.