Skip to content

Module '<namespace package>' has no attribute '<module/pkg in namespace>' #9619

@jaraco

Description

@jaraco

Bug Report

Attempting to run mypy on jaraco.ui, I'm getting an error:

_________________________________________________ jaraco/ui/cmdline.py _________________________________________________
5: error: Module 'jaraco' has no attribute 'text'

Here is the pertinent code, namely:

from jaraco import text

The module text is supplied by a separate package jaraco.text. The jaraco namespace uses the pkgutil style namespaces (mostly for historical reasons as the code is Python 3-only now, but could still interact with older builds).

This issue is related to #9393, although that issue indicates a different failure mode. Also possibly relevant #6385, #7029.

To Reproduce

git clone https://github.com/jaraco/jaraco.ui
cd jaraco.ui
git checkout eacca37
tox -- -k cmdline

Expected Behavior

mypy should recognize working implementations of extant modules and not fail.

Actual Behavior

Error reported above is emitted.

Your Environment

  • Mypy version used: 0.790
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files):
    ignore_missing_imports = True
  • Python version used: 3.9.0
  • Operating system and version: macOS 10.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy