microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 676 forks source link

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

Open ttSpace opened 2 weeks ago

ttSpace commented 2 weeks ago

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 "" Info: (22500) Starting service instance "FlaskWebProject1" Info: (22500) No include entries specified; assuming \ 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 "" Info: (20716) No include entries specified; assuming \ Info: (20716) Auto-excluding **/node_modules Info: (20716) Auto-excluding **/__pycache__ Info: (20716) Auto-excluding **/.* Error: (20716) File or directory "\" 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 \ Info: (20716) Auto-excluding **/node_modules Info: (20716) Auto-excluding **/__pycache__ Info: (20716) Auto-excluding **/.* Error: (20716) File or directory "\" does not exist. Info: (20716) No source files found. Info: Un-registering request handler for 56a901cb-4729-46b9-8642-f8ca6c8fe651 failed. ```

StellaHuang95 commented 2 weeks ago

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

bschnurr commented 2 weeks ago

@ttSpace any custom pylance settings?

ttSpace commented 2 weeks ago

@bschnurr My Pylance settings are default.

axelande commented 2 weeks ago

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

axelande commented 2 weeks ago

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

ttSpace commented 2 weeks ago

I can repro it in today's build.

Image

FlaskWebProject1.zip