Unable to install Pytorch in Ubuntu

Viewed 1638

I'm using the following command to install pytorch in my conda environment.

conda install pytorch=0.4.1 cuda90 -c pytorch

However, I'm getting the following error

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • pytorch=0.4.1
  • cuda90

Current channels:

To search for alternate channels that may provide the conda package you're looking for, navigate to

https://anaconda.org

How can I sort this out? I have ofcourse installed cuda 9 and nvcc works.

2 Answers

Go directly to the pytorch website and follow the instructions for your setup and it will tell you exactly the command required to install - pytorch - get started

For example:

enter image description here

If you're looking for older versions of PyTorch, the version history and commands to install can be found here - Installing Previous Versions of PyTorch

If this doesn't work for you, your last option is to build from source yourself. Here's the GitHub repo for version 0.4.1 - pytorch at 0.4.1. The steps to install from source are outlined on the repo here.

It seems to me that it is the version number that is giving the issue. For starters, to specify a particular version, you cannot use '=' sign. If you are particularly looking for the same version your specified, I'd recommend trying pytorch0.4.1 as the package name or else you could grab the latest version by:

conda install -c pytorch pytorch

You could refer to this site for CUDA: https://anaconda.org/anaconda/cudatoolkit

or if this is the right one for you, run this command

pip3 install pycuda
Related