pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

reportMissingImports when using multi-root workspace

Open andresespinosapc opened this issue 2 years ago • 2 comments

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

  1. Open VSCode, go to File -> Add Folder to Workspace, and add a folder with a Python project.
  2. 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.

andresespinosapc avatar Jul 14 '23 14:07 andresespinosapc

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?

heejaechang avatar Jun 24 '24 17:06 heejaechang