You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create 2 different folder structures that will have a src folder and a python package name that is the same
On the first python package init file add __path__ = pkgutil.extend_path(__path__, __name__)
Add both python src folder to a workspace "python.analysis.extraPaths" to have auto complete and code intelissence
Try importing python code from both of the folders. One of them will fail depending on the order of paths in "python.analysis.extraPaths"
Expected behavior
Pylance should be able to pick up that the python packages are extending the namespace
Actual behavior
Pylance fails to read content of one of the packages.
Extra note
The python.analisys.autoSearchPaths does work correctly and if you are withing a same workspace that has all the src folders within the space of the same root folder. Things work. But if another workspace is trying to "reference" code from another package it does not.
The text was updated successfully, but these errors were encountered:
Pyright (the type checker upon which Pylance is built), does not support dynamic modification of __path__. Here are several old Pyright issues discussing this that have some more detail:
If I misunderstood what you were asking for here, feel free to provide more detail and reopen the issue. In that case, a repo or zip file with a folder structure that reproduces the issue would be helpful.
Environment data
Code Snippet
Repro Steps
__path__ = pkgutil.extend_path(__path__, __name__)
src
folder to a workspace"python.analysis.extraPaths"
to have auto complete and code intelissenceExpected behavior
Pylance should be able to pick up that the python packages are extending the namespace
Actual behavior
Pylance fails to read content of one of the packages.
Extra note
The
python.analisys.autoSearchPaths
does work correctly and if you are withing a same workspace that has all thesrc
folders within the space of the same root folder. Things work. But if another workspace is trying to "reference" code from another package it does not.The text was updated successfully, but these errors were encountered: