Home > Software engineering >  Unable to find pytorch==1.11.0 from inside continuumio/miniconda3 Docker container
Unable to find pytorch==1.11.0 from inside continuumio/miniconda3 Docker container

Time:08-30

I'm trying to get pytorch==1.11.0 using the continuumio/miniconda3:4.12.0 Docker image.

I first run docker run -i -t continuumio/miniconda3 /bin/bash. Then, in the container, I run: conda search -c conda-forge pytorch==1.11.0. Here's the error:

No match found for: pytorch==1.11.0. Search: *pytorch*==1.11.0

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

  - pytorch==1.11.0

Current channels:

  - https://conda.anaconda.org/conda-forge/linux-aarch64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/linux-aarch64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-aarch64
  - https://repo.anaconda.com/pkgs/r/noarch

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

    https://anaconda.org

and use the search bar at the top of the page.

I then tried conda config --append channels conda-forge before running conda search -c conda-forge pytorch==1.11.0 again. Got the same error.

To test the network connection I ran conda search pytorch, so it'd search the default channel for any pytorch package. It's successful:

Loading channels: done
# Name                       Version           Build  Channel             
pytorch                        1.8.1 cpu_py37he9ab0f8_0  pkgs/main           
pytorch                        1.8.1 cpu_py38he9ab0f8_0  pkgs/main           
pytorch                        1.8.1 cpu_py39he9ab0f8_0  pkgs/main           
pytorch                       1.10.2 cpu_py310h65e219b_0  pkgs/main           
pytorch                       1.10.2 cpu_py37ha034a5a_0  pkgs/main           
pytorch                       1.10.2 cpu_py38ha034a5a_0  pkgs/main           
pytorch                       1.10.2 cpu_py39ha034a5a_0  pkgs/main  

Curiously, when I run conda search -c conda-forge pytorch==1.11.0 outside of the container, in my local terminal, it's available:

Loading channels: done
# Name                       Version           Build  Channel             
pytorch                       1.11.0 cpu_py310h61528c5_1  conda-forge         
pytorch                       1.11.0 cpu_py310h61528c5_2  conda-forge         
pytorch                       1.11.0 cpu_py310he9514b4_0  conda-forge         
pytorch                       1.11.0 cpu_py38h17550ec_1  conda-forge         
pytorch                       1.11.0 cpu_py38h17550ec_2  conda-forge         
pytorch                       1.11.0 cpu_py38h1b6422d_0  conda-forge         
pytorch                       1.11.0 cpu_py39h03f923b_1  conda-forge         
pytorch                       1.11.0 cpu_py39h03f923b_2  conda-forge         
pytorch                       1.11.0 cpu_py39h19aa3d3_0  conda-forge     

Why's this the case and how do we fix it?

CodePudding user response:

The "Current channels" in the error message showing linux-aarch64 indicates that the Docker image is arm64. Conda Forge only added such pytorch builds in v1.12.0; the anaconda channel does offer some earlier builds, but only up to v1.10.

Otherwise, maybe you didn't actually want an arm64 Docker image. In that case, one can specify the platform in docker CLI with the --platform argument, e.g., --platform=linux/amd64.


P.S. I'd use a Mambaforge container instead.

  • Related