How to install PyTorch on Windows [Step-by-Step]

by Vlad Turiceanu
Vlad Turiceanu
Vlad Turiceanu
Passionate about technology, Windows, and everything that has a power button, he spent most of his time developing new skills and learning more about the tech world. Coming... read more
Affiliate Disclosure
  • Installing PyTorch on Windows OS should not be a difficult process for programming techies.
  • You have to get the Anaconda auxiliary package, then you install PyTorch from the official site.
  • After the installation, take a look at our Development Tools Hub for more articles on development & IT-related software.
  • If you want to read more tutorials, we also have a dedicated How-To page as well.
how do i install pytorch

To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer's security and performance
  • Restoro has been downloaded by 0 readers this month.

PyTorch is a popular machine learning library, easier to learn than other similar deep learning tools, according to specialists.

Before installing PyTorch, you must make sure you meet some prerequisites. Namely, to run Windows 7 or greater, Windows Server 2008 r2 or greater.

It is also recommended to have already installed the Anaconda auxiliary package for PyTorch 3.x (the only version compatible with Windows).

In short, installing PyTorch involves two steps: getting the auxiliary packages (included in the Anaconda Python package manager) and then run the install command that the developer offers on their official page, depending on your settings.

How do I install PyTorch?

1. Download and install  Anacondainstalling pytorch

  1. Go to the official Anaconda site and find the right installer.
  2. Click on it to download and then hit Run.
  3. You can accept default settings and follow the prompts to finish the installation.

2. Install PyTorchcan i install pytorch on windows

  1. Use the official PyTorch local installation instructions.
  2. Choose your configuration. Note that there is no need to install CUDA separately, but you have to select a version of CUDA if your system supports Nvidia GPU.
  3. Run the recommended command to complete the installation.

The process doesn’t take long, but if it fails, you’ll get a specific error message. Most of the time, it’s a version compatibility issue.

3. Verify the installation

You should verify if the installation was successful, open a command shell , and enter python to launch the Python interpreter, then type the following:verify pytorch installation

Additionally, you can check if your GPU driver and CUDA are enabled, with the following command:

import torch

That’s about it! We hope you found this article useful. If you have anything that you might want to add for this installation process, please use the comments section below.

idee restoro Still having issues? Fix them with this tool:
  1. Download this PC Repair Tool rated Great on (download starts on this page).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues with Patented Technologies (Exclusive Discount for our readers).

Restoro has been downloaded by 0 readers this month.

Frequently Asked Questions

  • Yes, PyTorch can be installed on Windows since 2018, starting version PyTorch  0.4.0. The library can be installed on Windows OS via Conda or Pip command line.

  • You have to download the official PyTorch pip package and copy it to the offline computer. Then run pip install * command on the offline computer, in the copied folder.

  • Yes, PyTorch installs a CUDA toolkit. But you have to check if you have a CUDA-capable device before installing PyTorch, and which version is better.