2

For instance, say I want to install the bioconda package gapfiller.

conda new -n gapfiller -c bioconda -c conda-forge gapfiller

If I run the above command, I get the following error:

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

  - boost[version='>=1.57.0,<1.57.1.0a0']

Current channels:

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

At this point, what is the next step I should take to determine which channel I need to start including?

I've tried looking at the meta.yml for the package, but that only lists the packages that gapfiller depends on, not the channels that they can be found in. I've also tried conda search boost, but of course that only returns (incompatible) results in my current channels, it doesn't tell me how to find new channels:

$ conda search boost
Loading channels: done
# Name                       Version           Build  Channel             
boost                         1.65.1          py27_4  pkgs/main           
boost                         1.65.1  py27h0eb07c9_3  pkgs/main           
boost                         1.65.1          py35_4  pkgs/main           
boost                         1.65.1  py35heb9229b_3  pkgs/main           
boost                         1.65.1          py36_4  pkgs/main           
boost                         1.65.1  py36hfaba7b9_3  pkgs/main           
boost                         1.67.0          py27_4  pkgs/main           
boost                         1.67.0          py35_4  pkgs/main           
boost                         1.67.0          py36_4  pkgs/main           
boost                         1.67.0          py37_4  pkgs/main           
boost                         1.71.0          py38_0  pkgs/main 

How can I determine the right channel to use to solve a PackagesNotFoundError?

Migwell
  • 18,631
  • 21
  • 91
  • 160
  • 2
    Search on anaconda.org, that will search all the channels. You can also specify a version to search for from within your current channels, or you can specify `-c` to `conda search`. – darthbith Apr 28 '20 at 14:19

1 Answers1

2

Often, when it comes to old package versions, they got relegated to the free channel which was taken off the defaults metachannel last year. There are a few ways to add it back in (e.g., config setting restore_free_channel or env variable CONDA_RESTORE_FREE_CHANNEL), but a straightforward ad hoc solution is to include it as a one of the channels:

conda install -c free ...

For boost=1.57 on linux-64 platform, I see

conda search -c free boost=1.57[subdir='linux-64']
Loading channels: done
# Name                       Version           Build  Channel             
boost                         1.57.0               0  free                
boost                         1.57.0               1  free                
boost                         1.57.0               4  free   
merv
  • 67,214
  • 13
  • 180
  • 245
  • Hmm well in this case you're correct. But is this a general solution? – Migwell Apr 30 '20 at 14:49
  • @Migwell general? No, not really - at least nothing programmatic. As darthbith mentioned, Anaconda.org let's you search for packages, and that includes user channels (i.e., use-at-your-own-risk). Generally, you only want to use channels you trust. Most packages are on either **defaults** or **conda-forge** (or for me **bioconda**), with some older ones relegated to **free**, plus an occasional organization channel, e.g., **pytorch** for bleed-edge releases. – merv Apr 30 '20 at 22:56