- 1 year ago
Can't install torch (windows)
If you are having trouble installing PyTorch on Windows, here are some steps you can try:
Check your Python version: Make sure you are using a compatible version of Python with PyTorch. Currently, PyTorch supports Python 3.6, 3.7, 3.8, and 3.9 on Windows. You can check your Python version by running
python --version
in a command prompt.Install Microsoft Visual C++ redistributable: PyTorch requires the Microsoft Visual C++ redistributable to be installed on your system. You can download and install the latest version from the Microsoft website.
Install the correct PyTorch version: Make sure you are installing the correct version of PyTorch for your system. You can find the appropriate installation command for your system on the PyTorch website. For example, if you have Python 3.7 installed on a 64-bit system, you can install PyTorch with the command:
rubypip install torch==1.9.0+cpu torchvision==0.10.0+cpu torchaudio===0.9.0 -f https://download.pytorch.org/whl/cpu/torch_stable.html
Check your pip version: PyTorch requires pip version 19.0 or later to be installed. You can check your pip version by running
pip --version
in a command prompt. If your pip version is outdated, you can upgrade it with the command:csspython -m pip install --upgrade pip
Check your internet connection: PyTorch requires an internet connection to download and install its dependencies. Make sure you have a stable internet connection and that there are no network issues preventing the installation.
If none of these steps resolve the issue, you can try installing PyTorch from the source code or using a pre-built binary package instead of using pip
. You can find more information on these methods in the PyTorch documentation.