Install Pytorch on Windows
Install Pytorch with pip
The Windows version of PyTorch was never uploaded to PyPi because of the binary size limits.
When installing it you will end up getting the RuntimeError: PyTorch does not currently provide packages for PyPI
error.
To successfully install with pip you need to specify the URL locations to the PyTorch wheel:
1
2
3
4
5
pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
Note that this will install the PyTorch with CUDA. If your system hasn’t an NVIDIA GPU install the CPU version instead:
1
2
3
pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Install Pytorch with Conda
The Conda installation is straight forward:
1
2
3
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
and without CUDA:
1
2
3
conda install pytorch torchvision cpuonly -c pytorch
For additional installation options as LibTorch or installation from Source check the Start Locally
guide at https://pytorch.org/.