Installing PyTorch on Windows PC

Etornam Sunu Bright
2 min readJun 4, 2019

I recently got a Scholarship from Facebook and Udacity (Secure and Private AI) and in setting up my PyTorch environment, I face some issues which i realized a lot of people also faced. While the solution is available, it is scattered all round and you will have to research for a while to get it.

This quick post will identify how to:

  • Installation of Anaconda
  • Setting up of Anaconda
  • Installation of OpenSSL
  • Installation of PyTorch and other dependencies.

INSTALLATION AND SET UP OF ANACONDA

The easiest way to install PyTorch and torchvision locally is by following the instructions on the PyTorch site. Choose the stable version, your appropriate OS and Python versions, and how you’d like to install it. You’ll also need to install numpy and jupyter notebooks, the newest versions of these should work fine. Download the Anaconda setup and run it to install it on your PC.

INSTALLATION OF OPENSSL(Latest Version)

After installing Anaconda, i tried running the installation commands for pytorch and it failed over and over again. Searching online, i found pieces of solutions which i tried and they failed terribly. Upon further search, i discovered i need SSL on my PC. Although i had a version of OpenSSl already installed, it was an old version. I downloaded the latest version and installed then everything work! You can get OpenSSl from here.

additional task select

Once installed successfully, add OpenSSL to your Environment variables. proceed to the installation of PyTorch and other dependencies.

INSTALLATION AND SET UP OF PYTORCH AND OTHER DEPENDENCIES

Now, to install PyTorch, TorchVision and Cuda, open Anaconda Prompt as Administrator by right-clicking on it and select Run as Administrator. Then run:

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

following the installation instruction to successfully install it.

Now, to install Numpy, Jupyter Notebook, run:

conda install numpy jupyter notebook

This may take some time. After it is done, you have successfully install PyTorch. Congrats!!!

That’s all for now. ✌🏾

--

--

Etornam Sunu Bright

Mobile and Backend engineering. Flutter Africa Community Co-organizer 🌍.