Is there a way in pants to get torch/ torchXX to b...
# general
b
Is there a way in pants to get torch/ torchXX to be pulled from a specific pip url? The background to this is that I ran into a missing cuda so
libcudart.so.12
file after installing torch 2.2.1 on Linux. (FWIW the lock file had all the linux== dependencies that were not there on earlier 2.xx torch). I would just need a plain CPU environment, and the pytorch docs suggested a specific url, in contrast to the 'cuda' environments.
Copy code
pip3 install torch torchvision torchaudio --index-url <https://download.pytorch.org/whl/cpu>
l
You can use python-repos indexes to do that:
Copy code
[python-repos]
indexes.add = ["<https://download.pytorch.org/whl/cpu>"]
but that would mean all your requirements would be checked against that index. I am not sure if you can say "use that index url for the pytorch only."
b
Thanks, will just give that a go now. I had found a mention of indexes = [] in the archives but that failed (to generate lock files), presumably as the index i specified will only have torch stuff.
That almost worked, but came unstuck with 403 on some pytorch hosted wheels -looks like the urls were not correct. I think https://pantsbuild.slack.com/archives/C046T6T9U/p1709001165905529?thread_ts=1708545375.481409&cid=C046T6T9U has to be where I need to go
l
Btw, there is a tracking GitHub issues for improving workflow for PyTorch -> https://github.com/pantsbuild/pants/issues/18965
b
Thanks.. Some very helpful info here.