# AttributeError: module 'setuptools' has no attribute 'setup'

- **ID:** `python/pip-egg-info-attribute-error`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Incorrect import statement or shadowed module name. Often caused by a local file named 'setuptools.py' or importing setuptools incorrectly after a partial installation.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Check for and rename local setuptools.py, then run: python -c "import setuptools; print(setuptools.__file__)"
   ```
2. **** (80% success)
   ```
   Explicitly import: import setuptools; setuptools.setup()
   ```

## Dead Ends

- **** — If a local setuptools.py file exists in the working directory, it shadows the real package regardless of reinstallation. (70% fail)
- **** — Wildcard imports can hide the actual attribute if the module namespace is polluted or if there's a circular import. (50% fail)
