Skip to content

from . import util causes "Cannot resolve imported module . ty(unresolved-import)" error #2629

@North101

Description

@North101

Summary

I'm running my script as a module and using relative imports but any . import fails. The script runs fine so my project is setup correctly.

If I change it to from src import util then it no longer errors.
The autocomplete wants to import it as import util which fails when it runs but will correctly discover all functions etc.

Project directory
Image

Version

2026.6.0 (via VSCode Marketplace)

Metadata

Metadata

Assignees

No one assigned

    Labels

    importsModule resolution, site-packages discovery, import-related diagnostics

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions