# ERROR: Invalid requirement: '--extra-index-url https://example.com/simple' (from line 3 of requirements.txt)
Hint: Requirements must be in the form 'package[extras]==version'.

- **ID:** `python/pip-requirements-parse-error-options`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A global option like --extra-index-url is placed after a package line in requirements.txt; pip only accepts global options at the top of the file, before any requirement.

## Version Compatibility

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

## Workarounds

1. **** (98% success)
   ```
   Move all global options to the top of requirements.txt:
  --extra-index-url https://example.com/simple
  --trusted-host example.com
  foo==1.2.3
  bar>=2.0
   ```
2. **** (95% success)
   ```
   Alternatively pass options on the CLI:
  pip install -r requirements.txt --extra-index-url https://example.com/simple
   ```

## Dead Ends

- **** — Quoting turns it into an invalid package name; pip still rejects it. (95% fail)
- **** — Global options are only valid before the first requirement; moving to the end does not help. (90% fail)
