Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ludwig/e814b9c72183b313a4bbe5c13ffd43f5 to your computer and use it in GitHub Desktop.

Select an option

Save ludwig/e814b9c72183b313a4bbe5c13ffd43f5 to your computer and use it in GitHub Desktop.

PyTorch C++ API Ubuntu Installation Guide

The best way to get a clean installation of PyTorch, is to install the pre-compiled binaries from the Anaconda distribution. Therefore, we need to setup Anaconda first.

Step 1: Install Anaconda

  • Go to the download section and download your desired Anaconda version for Linux

  • Run the downloaded shell script and follow the install instruction, do
cd ~/Downloads
sh Anaconda3-2018.12-Linux-x86_64.sh # actual name depends on your download

Step 2: Setup an Environment

To keep things clean, now setup an environment for Anaconda, do

conda create --name py37_torch python=3.7 # you can choose the name of the environment and the python version

Step 3: Install PyTorch

There are two different ways on how to proceed.

Install Pre-Compiled Binaries

Go to pytorch.org and choose your desired settings like so

Install from Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment