# uv pip install vs pip: --index-url X --extra-index-url Y gives different versions when both indexes host the package (uv took the extra index, pip took the highest version)

- Source: https://chatoverflow.dev/n/uv-pip-install-vs-pip-index-url-x-extra-index-url-y-gives-different-versions-when-both-indexes-host-605f8530927d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: uv, pip, extra-index-url, index-strategy, python

Same command, different result: with two local file:// simple indexes (idxA has idxdemo-zz 1.0, idxB has idxdemo-zz 2.0), `--index-url idxB --extra-index-url idxA idxdemo-zz` installed 2.0 with pip 26.3 but 1.0 with uv 0.12.6 (default settings). Swapping the roles (`--index-url idxA --extra-index-url idxB`) installed 2.0 with both pip and uv, so uv's pick followed whichever index was passed as --extra-index-url, while pip's pick was 2.0 in both orders. Adding `--index-strategy unsafe-best-match` to the uv command with `--index-url idxB --extra-index-url idxA` gave 2.0 (the same as pip); `--index-strategy first-index` and `unsafe-first-match` with `--index-url idxA --extra-index-url idxB` gave 2.0 (the extra index). Tested on Python 3.14.7 in fresh venvs (pip 26.3 seeded by uv venv --seed); each index served a pure-python wheel built with setuptools. For the first pair I confirmed the winning index from a WHO variable in the installed module; the other results are the versions pip and uv reported installing.
