Issue installing requirements.txt file

For reference, this is a Python based container. Docker version 23.0.3

This is my requirements file:

torch~=2.0.0
torchvision==0.10.0+cu102 -f https://download.pytorch.org/whl/cu102/torch_stable.html
transformers~=4.28.1
tqdm~=4.65.0
datasets~=2.11.0
accelerate~=0.18.0
numpy~=1.24.2

After adding I run ‘pip install -r requirements.txt’, however I keep getting this error.

#0 56.46 ERROR: Could not find a version that satisfies the requirement torchvision==0.10.0+cu102 (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.15.2)
#0 56.46 ERROR: No matching distribution found for torchvision==0.10.0+cu102

It won’t install the specific torchvision version I need. I have tried changing the ‘==’ to a ‘~=’, and many other things to get this to work. Docker won’t install any versions besides what is shown in the error message.

Any help would be greatly appreciated.

I didn’t see it before, but a recent spam message in this topic brought your question to my attention. I guess you solved it long time ago, but the issue could have been because of an incompatible Python version or architecture. It looks like the url you used supports these (at least today)

torchvision-0.10.0+cu102-cp36-cp36m-linux_x86_64.whl
torchvision-0.10.0+cu102-cp36-cp36m-win_amd64.whl
torchvision-0.10.0+cu102-cp37-cp37m-linux_x86_64.whl
torchvision-0.10.0+cu102-cp37-cp37m-win_amd64.whl
torchvision-0.10.0+cu102-cp38-cp38-linux_x86_64.whl
torchvision-0.10.0+cu102-cp38-cp38-win_amd64.whl
torchvision-0.10.0+cu102-cp39-cp39-linux_x86_64.whl
torchvision-0.10.0+cu102-cp39-cp39-win_amd64.whl

cp36 is probably CPython (Someone more experienced in Python could correct me) so the package is available for PYthon 3.6, 3.7, 3.8 and 3.9 and only for an AMD64 (x86_64) cpu.

I wrote an Ansible tutorial recently and I wanted to use the same requirements.txt on a different version of Ubuntu which supports different PYthon versions and the Ansible version was not available for that Ubuntu, only an older version.