pylance-release
pylance-release copied to clipboard
reportMissingImports when using multi-root workspace
Environment data
- Language Server version: 2023.7.20
- OS and version: MacOS 13.3.1
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.1
Problem
Modules are not resolved when using multi-root workspaces. It works perfectly if I open the same problem in a new VSCode window. I could manage to fix this for packages by hardcoding the Python env path in settings.json, but it's not solved for modules that are in my project's directory.
Repro Steps
- Open VSCode, go to File -> Add Folder to Workspace, and add a folder with a Python project.
- Import a module that is in the root of the project
Expected behavior
The module should be resolved
Actual behavior
Pylance shows a warning saying "Import XXX could not be resolved".
Logs
I'm not sure if I should include all the logs, there are a lot.
can you share a repro project with us? like github repo with sample code that repro the issue? or at least, give us step by step instructions and file structures so we can repro it ourselves?