Skip to content

Does pyright detect the conditional dependencies when linting? #8926

Answered by erictraut
kemingy asked this question in Q&A
Discussion options

You must be logged in to vote

The typeshed stub file for the importlib.resources module indicates that files is available for Python 3.9 and newer. See this link for details.

If pyright indicates that it can't find the files symbol, that's probably because you've configured it to assume Python 3.8 or older. By default, python will use the Python version from the python environment you've configured from the command-line shell. Type python3 --version to see the version of the active python environment. If it's not what you're expecting, then activate the intended python environment before running pyright.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kemingy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants