# ImportError: No module named 'requests' after pip install --target ./lib requests

- **ID:** `python/pip-target-not-in-path`
- **Domain:** python
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pip install --target installs into the given directory but does not add it to sys.path. The interpreter cannot find the package unless PYTHONPATH or sys.path is updated.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   export PYTHONPATH=$PWD/lib:$PYTHONPATH && python -c 'import requests'
   ```
2. **** (90% success)
   ```
   import sys, os; sys.path.insert(0, os.path.abspath('./lib')); import requests
   ```
3. **** (85% success)
   ```
   echo $(pwd)/lib > $(python -c 'import site; print(site.getsitepackages()[0])')/mylib.pth
   ```

## Dead Ends

- **** — Reinstalling does not change sys.path. (95% fail)
- **** — pip still installs to the active environment's site-packages, not the cwd. (90% fail)
