-
Notifications
You must be signed in to change notification settings - Fork 766
FAQ
Suggested fixes to common problems, garnered from the issues.
If you want to use static analysis tools with an editable install, you should configure the editable install to use .pth
files that contain file paths rather than executable lines (prefixed with import
) that install import hooks.
For more details, see Pyright's editable install documentation.
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.
The first step in switching Pylance builds, regardless of which build you want, is to select Pylance in VS Code's Extensions pane:
This will show a tab containing details on the version that is currently installed:
To switch from Release to Prerelease, click the "Switch to Pre-Release Version" button:
Similarly, to switch from Prerelease to Release, click the "Switch to Release Version" button:
And to switch to a particular version (ex. to roll back to an earlier version), expand the "Uninstall" combo box and select "Install Another Version...". You will be presented with a list of Pylance versions to choose from: