# ImportError: cannot import name 'foo' from partially initialized module 'mypkg' (most likely due to a circular import)

- **ID:** `python/setuptools-namespace-package-conflict`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Namespace package layout misconfigured via setup.py/pyproject.toml, causing circular or partial imports.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## Workarounds

1. **** (85% success)
   ```
   from setuptools import setup, find_namespace_packages
setup(name='mypkg', packages=find_namespace_packages(include=['mypkg.*']))
   ```
2. **** (90% success)
   ```
   [tool.setuptools.packages.find]
namespaces = true
include = ["mypkg*"]
   ```

## Dead Ends

- **** — Breaks the intended namespace-package semantics and can cause duplicate module paths. (70% fail)
- **** — Masks the layout issue; import may still fail elsewhere. (60% fail)
