Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--extra-index-url causes uv unable finding numpy>=1.23,<1.24 #7554

Closed
zhou13 opened this issue Sep 19, 2024 · 3 comments
Closed

--extra-index-url causes uv unable finding numpy>=1.23,<1.24 #7554

zhou13 opened this issue Sep 19, 2024 · 3 comments
Labels
question Asking for clarification or support

Comments

@zhou13
Copy link

zhou13 commented Sep 19, 2024

To reproduce

echo "--extra-index-url https://download.pytorch.org/whl/cu118" > requirements.in
echo "numpy>=1.23,<1.24" >> requirements.in
uv pip compile --python-platform linux --python-version 3.10 requirements.in

I got

  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of numpy are available:
          numpy<1.23
          numpy>1.24
      and you require numpy>=1.23,<1.24, we can conclude that your requirements are unsatisfiable.

However, numpy==1.23.5 exists. You can verify it by

echo "numpy>=1.23,<1.24" > requirements.in
uv pip compile --python-platform linux --python-version 3.10 requirements.in

I got

# This file was autogenerated by uv via the following command:
#    uv pip compile --python-platform linux --python-version 3.10 requirements.in
numpy==1.23.5
    # via -r requirements.in

The current uv version (uv --version)

uv 0.4.12 (2545bca69 2024-09-18)
@charliermarsh
Copy link
Member

You will need --index-strategy unsafe-first-match. Read here: https://docs.astral.sh/uv/pip/compatibility/#packages-that-exist-on-multiple-indexes

@charliermarsh charliermarsh added the question Asking for clarification or support label Sep 19, 2024
@zhou13
Copy link
Author

zhou13 commented Sep 19, 2024

Thank you for the quick response!

@zhou13 zhou13 closed this as completed Sep 19, 2024
@charliermarsh
Copy link
Member

No problem. We have an open issue to add dedicated error messages for this to make it more obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

2 participants