Introduction
When using an Artifactory PyPI remote repository to proxy PyTorch packages, downloading torchvision may fail with errors similar to:
is not of the allowed hosts. Allowed are: [download.pytorch.org]
From logs:
https://download-r2.pytorch.org/... is not of the allowed hosts
This prevents Artifactory from resolving and downloading certain .whl files.
Resolution
The Correct Configuration of PyPI remote repositories
- Remote Repository URL
https://download-r2.pytorch.org/
- PyPI Settings
Registry URL
https://download.pytorch.org/
https://download-r2.pytorch.org/
Registry Index Location URL Suffix
whl
Configuration Example
Verifying Results
After applying the configuration above, running the following test to validate:
pip3 install torch==2.8.0+cpu torchvision torchaudio \
--index-url http://admin:XXXXX@localhost:8082/artifactory/api/pypi/manu-pypi2/simple
Observed Behavior
Collecting torch==2.8.0+cpu
Using cached .../whl/cpu/torch-2.8.0+cpu...
Collecting torchvision
Downloading .../whl/cu130/torchvision-0.26.0+cu130...
Downloading .../whl/cu129/torchvision-0.26.0+cu129...
Downloading .../whl/cu128/torchvision-0.26.0+cu128...
Downloading .../whl/cu126/torchvision-0.26.0+cu126...
Downloading .../whl/cpu/torchvision-0.26.0+cpu...
Collecting torchaudio
Downloading .../whl/cu130/torchaudio-2.11.0+cu130...
The downloading process is successful.