3

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.

4
  • I trimmed the links since stackoverflow wont allow me to post more than 8 links as I don't have enough points. Commented Aug 5, 2020 at 20:00
  • 2
    Not all packages and versions available via pip are available via conda packages. conda has some version of pytorch available, but doesn't appear to have 0.4.1. The latest 1.6.0 is available. Commented Aug 5, 2020 at 20:07
  • 1
    The version you are trying to install is very old, try installing newer version( currently 1.6.0 is the most recent), you can generate install command for conda via pytorch website in the getting started section Commented Aug 5, 2020 at 20:11
  • The code that i'm trying is in 0.4.1 :( Commented Aug 5, 2020 at 20:15

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I would like to install version 0.4.1 :(
I tried ` conda install pytorch torchvision cudatoolkit=9.2 -c pytorch` and it throws the same error :(
Added a further option to answer above outlining building older versions from source.
1

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 

2 Comments

I tried conda install -c pytorch0.4.1 pytorch and it did not work :(
Could you try the instructions here and let me know if it works? github.com/pytorch/pytorch/issues/19457

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.