uv: uv pip install from private extra index url get 401 Unauthorized
Summary
Hey guys, I’m really surprised to have that bug since it occured a year ago and from the discussion I saw, a fix has been implemented but I am still getting this issue. I just started using uv couple of weeks ago and I am doing some deep tests to be sure it works well and to replace poetry by uv. Here is the thing: I am trying to install private package in private azure pypi but I am getting the famous 401 unauthorized. Here is the full verbose anonymized:
> uv pip install my-package==17.0.2 --extra-index-url https://username:password@my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server --verbose
DEBUG uv 0.7.2 (481d05d8d 2025-04-30)
DEBUG Searching for default Python interpreter in virtual environments
DEBUG Found `cpython-3.10.4-windows-x86_64-none` at `C:\Users\user\Documents\Project\uvPip_demo\.venv\Scripts\python.exe` (virtual environment)
DEBUG Using Python 3.10.4 environment at: .venv
DEBUG Acquired lock for `.venv`
DEBUG At least one requirement is not satisfied: my-package==17.0.2
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.10.4
DEBUG Solving with target Python version: >=3.10.4
DEBUG Adding direct dependency: my-package>=17.0.2, <17.0.2+
DEBUG Acquired lock for `C:\Users\user\AppData\Local\uv\cache\simple-v15\index\some-index\my-package.lock`
DEBUG Found stale response for: https://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/
DEBUG Sending revalidation request for: https://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/
DEBUG Found modified response for: https://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/
DEBUG Released lock at `C:\Users\user\AppData\Local\uv\cache\simple-v15\index\some-index\my-package.lock`
DEBUG Searching for a compatible version of my-package (>=17.0.2, <17.0.2+)
DEBUG Selecting: my-package==17.0.2 [compatible] (my-package-17.0.2-py3-none-any.whl)
DEBUG Acquired lock for `C:\Users\user\AppData\Local\uv\cache\wheels-v5\index\some-index\my-package\my-package-17.0.2-py3-none-any.lock`
DEBUG No cache entry for: http://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/my-package-17.0.2-py3-none-any.whl
WARN Range requests not supported for my-package-17.0.2-py3-none-any.whl; streaming wheel
DEBUG No cache entry for: http://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/my-package-17.0.2-py3-none-any.whl
DEBUG No netrc file found
DEBUG Released lock at `C:\Users\user\AppData\Local\uv\cache\wheels-v5\index\some-index\my-package\my-package-17.0.2-py3-none-any.lock`
DEBUG Released lock at `C:\Users\user\Documents\Project\uvPip_demo\.venv\.lock`
error: Failed to fetch: `http://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/my-package-17.0.2-py3-none-any.whl`
Caused by: HTTP status client error (401 Unauthorized) for url (https://my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server/my-package/my-package-17.0.2-py3-none-any.whl)
Platform
windows 11 x64
Version
0.7.2
Python version
3.10.4
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (11 by maintainers)
We checked with my MLE colleague and it seems like pip sends only GET while uv sends a HEAD on top of GET, and you were right, our private server does not support HEAD yet. We we are going to update our private repo so it supports HEAD also to be able to use uv.
I confirm both points are happening i.e.:
pip install your-package --index-url your-urlsucceeds.uv pip install your-package --default-index your-urlfails.Here is now the
uv pip installwith-vv>uv pip install my-password --default-index https://username:password@my-azure-endpoint.northeurope.cloudapp.azure.com/pypi-server -vv