Skip to content

reportMissingModuleSource on import bpy #437

Closed

Description

@Andrej730

It seems as a consequence of #433, now a warning pops up in VS Code ("Import "bpy" could not be resolved from source Pylance[reportMissingModuleSource]"):

Image

What do you think is the best workaround to avoid it?

Options that came to mind:

  1. # pyright: ignore[reportMissingModuleSource] on the same line - fixes it, but it might get noisy
  2. # pyright: reportMissingModuleSource=none at the top of the file/project - might disable this warning for other imports where it can be useful
  3. installing some older version of fake-bpy-module in parallel that doesn't have -stubs, but then it defies the puprose of Follow "Distributing type information" by renaming modules to *-stubs (such as bpy-stubs) #433

Thinking about it more, I can't find any scenario where reportMissingModuleSource might actually help in case of a Blender addon, since all the imports will be inside Blender's context either way, so their concrete sources shouldn't be discoverable inside VS Code project. So reportMissingModuleSource should become a new disabled setting in all Blender related projects, along the reportInvalidTypeForm we disable due to Blender API quirks.

Does it makes sense, any caveats to this?

Activity

  1. nutti commented on Mar 31, 2026

    @nutti
    Owner

    @Andrej730
    Agree.
    But are we able to address this issue from fake-bpy-module side?

  2. Andrej730 commented on Apr 1, 2026

    @Andrej730
    ContributorAuthor

    Probably not - only by

    3. installing some older version of fake-bpy-module in parallel that doesn't have -stubs, but then it defies the puprose of Follow "Distributing type information" by renaming modules to *-stubs (such as bpy-stubs) #433

    or using some other hack, which might break at some point. So, the recommendation for users to use reportMissingModuleSource is probably our best option.

  3. nutti commented on Apr 1, 2026

    @nutti
    Owner

    @Andrej730
    Then, shall we move to the discussion instead of issue?
    I want to use issue session as a bug / feature request only.

  4. Andrej730 commented on Apr 1, 2026

    @Andrej730
    ContributorAuthor

    @nutti sure, let's move it to discussions.

  5. Repository owner locked and limited conversation to collaborators on Apr 1, 2026
  6. converted this issue into a discussion #440 on Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions