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

Torch installation with requirement.txt file #597

Closed
mrava87 opened this issue Aug 9, 2024 · 0 comments · Fixed by #599
Closed

Torch installation with requirement.txt file #597

mrava87 opened this issue Aug 9, 2024 · 0 comments · Fixed by #599
Labels
bug Something isn't working

Comments

@mrava87
Copy link
Collaborator

mrava87 commented Aug 9, 2024

I copy-paste the comment of @cako from #590 here:

Just a heads up as this is something that has been annoying me as of late: --extra-index-url is a global option (doesn't matter where in the requirements.txt file is is specified) and has no predefined priority over the index URL (either standard index URL or an alternative one as specified by -i or --index-url).

Therefore, as per the specs, it is entirely possible that a torch from PyPI will be selected instead of the GPU version... or that a numpy from Pytorch (if it existed) would be selected instead of the PyPI one. As far as I have tested this in the past, this situation does not arise.

There is pypa/pip#8606 about setting channel priorities through pip, and uv uses a different logic to disambiguate. As far as workarounds go, what I am currently doing in other projects is to create a separate requirements-torch.txt with a single --index-url (overriding PyPI) and only adding torch-related packaged to that file. Something to consider!

@mrava87 mrava87 added the bug Something isn't working label Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant