Skip to content

"cannot perform relative import" with namespace packages #9307

Closed
@lilydjwg

Description

@lilydjwg
mkdir t
echo 'FOO = 1' > t/a.py
echo 'from . import a' > t/b.py
mypy t
  • What is the actual behavior/output?
t/b.py:1: error: No parent module -- cannot perform relative import
Found 1 error in 1 file (checked 2 source files)
  • What is the behavior/output you expect?
Success: no issues found in 2 source files
  • What are the versions of mypy and Python you are using?

mypy 0.782 and Python 3.8.5

  • Do you see the same issue after installing mypy from Git master?

yes

  • What are the mypy flags you are using? (For example --strict-optional)

None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions