Diagnostic for importing a module present in typeshed/stubs which is not installed should be reportMissingImports rather than reportMissingModuleSource #8046
Replies: 2 comments
-
|
Hi @jonathandung, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime. Potential Duplicate Issues – These issues may be duplicates of your report, but may differ in some of the details.
Similar Issues (FYI only, not solutions) The following issues may or may not be related to your report. They are provided for reference only, as they may describe similar symptoms, affect the same feature, or address related concerns, but may not be the same issue.
The team will respond to your issue shortly. Please note this is a trial feature and may not be fully accurate. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or was incorrect, please give it a 👎. Your feedback helps us improve! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the suggestion. Moving to discussion items for up votes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Type: Bug
Even when a third-party library such as
tensorflowis not installed in my virtual environment, and has never been, Pylance only produces a reportMissingModuleSource warning, when it should be a reportMissingImports error. This is frustrating, to say the least. This possibly stems from Pylance being able to find the annotations in its own distribution of typeshed. I believe that reportMissingModuleSource should only be raised when there is a stub outside of typeshed but the source is not present. In comparison, using symbols from a module such asnltkthat is not in typeshed correctly raises reportMissingImports. Even if the developer knows the required modules are always present and wants to patch the error, they would not go about inserting the stub in the Pylance typeshed-fallback folder or similar.Extension version: 2026.2.101
VS Code version: Code 1.119.0 (8b640eef5a6c6089c029249d48efa5c99adf7d51, 2026-05-05T11:23:50-07:00)
OS version: Windows_NT x64 10.0.26200
Modes:
System Added Logs
System Info
GPU0: VENDOR= 0x8086, DEVICE=0x9a49 [Intel(R) Iris(R) Xe Graphics], DRIVER_VENDOR=Intel, DRIVER_VERSION=32.0.101.6737 ACTIVE
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8328
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
Beta Was this translation helpful? Give feedback.
All reactions