You ask — we answer!

Apps & Guides

PyTorch for Windows

Before you begin installing PyTorch, you need to install the Python interpreter and Microsoft Visual C++ Redistributable. Open a web-browser and navigate to Python’s download page. Find the latest Python 3 release and click on the link:

Download Python release

Then scroll down the page and click on Windows Installer (64-bit):

Select binary

Open the downloaded file to proceed with installation:

Run the installer

Check the box for Add python.exe to PATH and click on Install Now:

Select Install Now and Add to PATH

Wait a minute for the installation process to complete:

Python setup process

You can optionally Disable path length limit if you plan to use long names that could exceed the MAX_PATH limits:

Python setup complete

Install MS Visual C++

Next, download Microsoft Visual C++ Redistributable using this link and click on the installer:

Run Microsoft visual C++ redistributable installer

You must tick the I agree to the license terms and conditions box and click the Install button:

Visual C++ accept EULA

After a few seconds, this software will be installed and you can Close the installer:

Visual C++ installation complete

Now, everything is ready for PyTorch installation. Click the Start button and type cmd on the keyboard. Right-click on Command Prompt and select Run as administrator from the context menu:

PyTorch install using PIP

Install PyTorch

Execute the following command:

pip install torch torchvision

If you want to install a specific version of PyTorch, you can specify it during the installation:

pip install torch==1.9.0 torchvision==0.10.0

When the installation is complete, let’s check that PyTorch is working properly. Execute the following command to open the Python interpreter:

python

Type these two strings, ending your input with the Enter key:

import torch
print(torch.__version__)

If you get a result like this, it means that PyTorch was installed correctly:

2.0.1+cu117

See also:



Updated: 26.03.2025

Published: 22.01.2025