Skip to content

VSCode unable to resolve imports with a custom comtypes.client.gen_dir path #867

@gexgd0419

Description

@gexgd0419

For example, I set comtypes.client.gen_dir to be comInterfaces, so that generated wrapper modules will appear in that directory, instead of the default location of comtypes.gen.

After generating the wrappers, I want to import the wrappers to get some type hints.

I cannot import from comtypes.gen, because the wrappers are not there, since I have moved them into comInterfaces.

I can import from comInterfaces, but then, VS code still cannot find the symbols inside the wrappers, because the generated wrappers still reference comtypes.gen._SomeLibraryID_ somehow.

Is there something I can tweak in comtypes to change the import paths inside those wrappers, so that they can work with static Python checkers? Or is there something I can change in the VS Code settings in order to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions