-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What you're really asking is the priority of different paths for resolving where an import comes from. The source for this actually is actually open sourced: The order it searches looks like:
The _pickBestImport then picks the paths that are considered local over 3rd party. Sorry, but I don't think it's possible to get it to pick the pip installed version. In that algorithm above, I believe it's finding it like so:
The version in the |
Beta Was this translation helpful? Give feedback.
What you're really asking is the priority of different paths for resolving where an import comes from. The source for this actually is actually open sourced:
https://github.com/microsoft/pyright/blob/60e4050e0a48a47c6a265f33b5d5084c095f8fd5/packages/pyright-internal/src/analyzer/importResolver.ts#L1550
The order it searches looks like:
The _pickBestImport then picks the paths that are considered local over 3rd party.
Sorry, but I don't think it's possible to get it to pick the pip installed version. In that algorithm a…