Skip to content
Rich Chiodo edited this page May 8, 2023 · 9 revisions

Suggested fixes to common problems, garnered from the issues.

Packages are not found when using editable installs

setuptools recently added support for PEP 660, which breaks a lot of tools that do static analysis, including pyright and pylance. The setuptools docs have instructions on how, for the time being, you can replicate the legacy behavior. Using strict mode is another option.

Type "foo" cannot be assigned to type "bar"

Here's a bunch of example issues that might be similar to your bug (which may provide a resolution):

'None' is unexpected in type Cannot assign literals to a TypeVar even when it's the same Union of types cannot be assigned to a specific type Union cannot be used in a list Unpack operator doesn't find the correct type Variable cannot be used as a type

Pyright also has documentation on this specific error that might help.

Clone this wiki locally