Ask questionspython.analysis.extraPaths setting supported?
Hi. Pylance looks great.
"python.analysis.extraPaths" setting in settings.json supported by the pylance extension? I can't seem to get it working and wanted to check it is actually used by pylance. Or is there another way to tell pylance about other paths to search for imports? Does pylance make use of the pyrightconfig.json file for example?
I have some pypi packages downloaded in a separate directory called
vendor and I'm trying to get pylance to search this extra directory.
More specifically, I have the directory
/home/myusername/myrepo/vendor/py_deps/pypi_beautifulsoup4/ which contains the
py4 beautiful soup package downloaded from pypi.
I can successfully run my python program by adding
PYTHONPATH, as an import such as
import py4 is then resolved correctly.
However with pylance I get a 'reportMissingImports error'. I've tried adding the path to my
vendor/pydeps/pypi_beautifulsoup4 directory to
"python.analysis.extraPaths" but I get the same error and can't tell if pylance is using this particular setting.
# /home/myusername/myrepo/src/somepackage/main.py import bs4 # Import "bs4" could not be resolved Pylance (reportMissingImports) def main(): pass
Answer questions qubitron
It doesn't look like python.analysis.extraPaths is documented on the README or the marketplace entry, so at the very least we should document it.
Related questionsNo questions were found.