PTVS icon indicating copy to clipboard operation
PTVS copied to clipboard

reportMissingImports : Even if the module is successfully installed, a warning will still be displayed in the Error List window.

Open ttSpace opened this issue 1 year ago • 6 comments

Describe the bug

Image

Steps to Reproduce

  1. Create a Flask Web Project.
  2. Click Create virtual environment ( Make sure Flask was successfully installed ).

Expected behavior

After Flask is successfully installed, no errors or warnings will be displayed.

Additional context and screenshots

Image

Logs

Output for Pylance in the Output panel

Info: (22500) Pylance language server 2024.9.104 (pyright version 1.1.382, commit e46efc6b) starting
Info: (22500) Server root directory: file:///c%3A/program%20files/microsoft%20visual%20studio/2022/preview/common7/ide/extensions/microsoft/python/core/pylance/dist
Info: (22500) Starting service instance "<default>"
Info: (22500) Starting service instance "FlaskWebProject1"
Info: (22500) No include entries specified; assuming \<default workspace root>
Info: (20716) Server root directory: file:///c%3A/program%20files/microsoft%20visual%20studio/2022/preview/common7/ide/extensions/microsoft/python/core/pylance/dist
Info: (20716) Pylance language server 2024.9.104 (pyright version 1.1.382, commit e46efc6b) starting
Info: (20716) Starting service instance "<default>"
Info: (20716) No include entries specified; assuming \<default workspace root>
Info: (20716) Auto-excluding **/node_modules
Info: (20716) Auto-excluding **/__pycache__
Info: (20716) Auto-excluding **/.*
Error: (20716) File or directory "\<default workspace root>" does not exist.
Info: (20716) No source files found.
Info: (20716) Background analysis(1) root directory: file:///c%3A/program%20files/microsoft%20visual%20studio/2022/preview/common7/ide/extensions/microsoft/python/core/pylance/dist
Info: (20716) Background analysis(1) started
Info: (20716) No include entries specified; assuming \<default workspace root>
Info: (20716) Auto-excluding **/node_modules
Info: (20716) Auto-excluding **/__pycache__
Info: (20716) Auto-excluding **/.*
Error: (20716) File or directory "\<default workspace root>" does not exist.
Info: (20716) No source files found.
Info: Un-registering request handler for 56a901cb-4729-46b9-8642-f8ca6c8fe651 failed.

ttSpace avatar Oct 09 '24 08:10 ttSpace

@bschnurr This user also mentioned it still repros for them in the latest version. https://github.com/microsoft/PTVS/issues/7068#issuecomment-2401292820

StellaHuang95 avatar Oct 09 '24 16:10 StellaHuang95

@ttSpace any custom pylance settings?

bschnurr avatar Oct 09 '24 18:10 bschnurr

@bschnurr My Pylance settings are default.

ttSpace avatar Oct 10 '24 01:10 ttSpace

@bschnurr is there any way to add settings to Pylance in the pyproj file?

axelande avatar Oct 10 '24 04:10 axelande

@ttSpace, can you share the .pyproj file and the folder structure (in which folders are your .pyproj file, src file and env folder located?)

axelande avatar Oct 10 '24 04:10 axelande

I can repro it in today's build.

Image

FlaskWebProject1.zip

ttSpace avatar Oct 11 '24 06:10 ttSpace

Closing as it's a duplicate of https://github.com/microsoft/PTVS/issues/7068, which is also open waiting for fix.

StellaHuang95 avatar Dec 17 '24 01:12 StellaHuang95