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
Python version (& distribution if applicable, e.g. Anaconda): XXX
Code Snippet
# No python code needed
Repro Steps
Create the following folders: C:/mainFolder/SubFolder, C:/mainFolder/SubFolder2, C:/mainFolder/3rdParty, C:/mainFolder/3rdParty/myExamplePackage
Create the following file: C:/mainFolder/3rdParty/myExamplePackage/_ _ init _ _ .py (markdown is screwing this up, use dunders)
Open VS Code and then click File>Open Folder. Select C:/mainFolder/SubFolder
Click File>NewFile and make a new python file.
In the new python file, type "import myExamplePackage"
NOTE that there IS a pylance unresolved import error.
In File > Preferences > Settings, change your Workspace > Python>Analysis>ExtraPaths to include the following: "../3rdParty"
in the file from step 5, notice that the import error goes away
in the Explorer pane, right click in the white space under your SubFolder(Workspace) section
Click "Add Folder to Workspace"
Select C:/mainFolder/SubFolder2
Look at the file from step 5
Expected behavior
'Import myExamplePackage' stays resolved
Actual behavior
Import does not resolve again. Sometimes it has pylance eror, other times myExamplePackage turns white and uninteractable.
If you remove the added SubFolder2, sometimes it remains broken until you close the window and reopen the workspace.
Logs
No logs needed
Extra Notes
I have many problems with analysis extra paths. I have variations of this same problem and no amount of absolute pathing or relative pathing fixes my imports. All of these appear to be caused by having more than 1 folder in a workspace.
The text was updated successfully, but these errors were encountered:
Also please note that changing the Python analysis extrapaths for both project folders, which supersedes the workspace setting, doesnt work either. Neither does changing the User version of extrapaths either
Environment data
Code Snippet
# No python code needed
Repro Steps
Expected behavior
'Import myExamplePackage' stays resolved
Actual behavior
Import does not resolve again. Sometimes it has pylance eror, other times myExamplePackage turns white and uninteractable.
If you remove the added SubFolder2, sometimes it remains broken until you close the window and reopen the workspace.
Logs
No logs needed
Extra Notes
I have many problems with analysis extra paths. I have variations of this same problem and no amount of absolute pathing or relative pathing fixes my imports. All of these appear to be caused by having more than 1 folder in a workspace.
The text was updated successfully, but these errors were encountered: