# ImportError: cannot import name 'setup' from 'setuptools' (/path/to/setuptools/__init__.py)

- **ID:** `python/setuptools-cannot-import-setup-from-setuptools`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A local file named setuptools.py shadows the package, or the installed setuptools is corrupted/incompletely uninstalled, leaving a partial __init__.py without setup.

## 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)
   ```
   find . -maxdepth 3 -name 'setuptools.py' -print
# rename/delete it
mv ./setuptools.py ./setuptools.py.bak
   ```
2. **** (85% success)
   ```
   python -m venv .venv && . .venv/bin/activate
pip install --upgrade --force-reinstall setuptools
   ```
3. **** (80% success)
   ```
   python -c "import setuptools, inspect; print(setuptools.__file__); print(hasattr(setuptools, 'setup'))"
   ```

## Dead Ends

- **** — If a local setuptools.py shadows the package, upgrade doesn't help. (70% fail)
- **** — It's a build-time dependency, not a runtime one. (85% fail)
- **** — Destroys the environment; you'll need to rebuild it. (90% fail)
