profile
viewpoint

Ask questionspython.analysis.extraPaths setting supported?

Hi. Pylance looks great.

Is the "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?

Thanks.

More info...

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 /home/myusername/myrepo/vendor/py_deps/pypi_beautifulsoup4/ to 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
microsoft/pylance-release

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.

useful!

Related questions

No questions were found.
Github User Rank List