conda PackagesNotFoundError for packages installed from "free" channel

Viewed 56

I'm trying to install fastspar into an existing conda environment, but I get the following ResolvePackageNotFound error:

conda install -c bioconda fastspar
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

ResolvePackageNotFound: 
  - defaults/linux-64::natsort==3.5.0=py27_0
  - defaults/linux-64::pyparsing==2.0.3=py27_0
  - defaults/linux-64::qt==4.8.7=3
  - defaults/linux-64::mkl==11.3.3=0
  - defaults/linux-64::mysql-python==1.2.5=py27_0
  - defaults/linux-64::freetype==2.5.5=1
  - defaults/linux-64::fontconfig==2.11.1=6
  - defaults/linux-64::numpy==1.10.4=py27_2
  - defaults/linux-64::cairo==1.12.18=6
  - defaults/linux-64::py2cairo==1.10.0=py27_2
  - defaults/linux-64::libgfortran==3.0.0=1
  - defaults/linux-64::libgcc-ng==7.2.0=hdf63c60_3
  - defaults/linux-64::scipy==0.17.1=np110py27_1
  - defaults/linux-64::libpng==1.6.17=0
  - defaults/linux-64::libstdcxx-ng==7.2.0=hdf63c60_3
  - defaults/linux-64::matplotlib==1.4.3=np110py27_2

However, these packages were indeed already installed, as results from conda list, but are flagged as installed from the obsolete conda channel free.

conda list |grep free

cairo                     1.12.18                       6    https://repo.anaconda.com/pkgs/free
fontconfig                2.11.1                        6    https://repo.anaconda.com/pkgs/free
freetype                  2.5.5                         1    https://repo.anaconda.com/pkgs/free
gdata                     2.0.18                   py27_0    https://repo.anaconda.com/pkgs/free
libgfortran               3.0.0                         1    https://repo.continuum.io/pkgs/free
libpng                    1.6.17                        0    https://repo.anaconda.com/pkgs/free
matplotlib                1.4.3               np110py27_2    https://repo.anaconda.com/pkgs/free
mkl                       11.3.3                        0    https://repo.anaconda.com/pkgs/free
mysql-python              1.2.5                    py27_0    https://repo.anaconda.com/pkgs/free
natsort                   3.5.0                    py27_0    https://repo.anaconda.com/pkgs/free
numpy                     1.10.4                   py27_2    https://repo.anaconda.com/pkgs/free
py2cairo                  1.10.0                   py27_2    https://repo.anaconda.com/pkgs/free
pyparsing                 2.0.3                    py27_0    https://repo.anaconda.com/pkgs/free
qt                        4.8.7                         3    https://repo.anaconda.com/pkgs/free
scipy                     0.17.1              np110py27_1    https://repo.anaconda.com/pkgs/free

Following the suggestion by @merv, I added free to my channel list

> conda config --add channels free
> conda config --set restore_free_channel true
> conda config --set channel_priority flexible
    
> conda config --show channels
    channels:
      - conda-forge
      - bioconda
      - defaults
      - free
      - biobakery

This made the trick to get rid of missing packages in free channel. However, a couple of new ResolvePackageNotFound error raised

conda install -c bioconda fastspar

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

ResolvePackageNotFound: 
- defaults/linux-64::libgcc-ng==7.2.0=hdf63c60_3
- defaults/linux-64::libstdcxx-ng==7.2.0=hdf63c60_3

This two packages are indeed present in my environment, but with no channel indication:

> conda list|grep "libgcc-ng\|libstdcxx-ng"

libgcc-ng                7.2.0                hdf63c60_3  
libstdcxx-ng             7.2.0                hdf63c60_3

Here I provide the conda info

     active environment : qiime_1_9_0
    active env location : /storage-daredevil/CONDA_ENVS/qiime_1_9_0
            shell level : 1
       user config file : $HOME/.condarc
 populated config files : $HOME/.condarc
                          /storage-daredevil/CONDA_ENVS/qiime_1_9_0/.condarc
          conda version : 4.11.0
    conda-build version : not installed
         python version : 3.9.7.final.0
       virtual packages : __linux=3.10.0=0
                          __glibc=2.17=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /opt/miniconda  (read only)
      conda av data dir : /opt/miniconda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/bioconda/linux-64
                          https://conda.anaconda.org/bioconda/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/linux-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://conda.anaconda.org/free/linux-64
                          https://conda.anaconda.org/free/noarch
                          https://conda.anaconda.org/biobakery/linux-64
                          https://conda.anaconda.org/biobakery/noarch
          package cache : /opt/miniconda/pkgs
                          $HOME/.conda/pkgs
       envs directories : /storage-daredevil/CONDA_ENVS
                          $HOME/.conda/envs
                          /opt/miniconda/envs
               platform : linux-64
             user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Linux/3.10.0-1160.59.1.el7.x86_64 centos/7.9.2009 glibc/2.17
                UID:GID : 1060:20
             netrc file : $HOME/.netrc
           offline mode : False

Can anyone help me? (I'm sorry the environment seems to be a mess, but someone else created it) Thank you very much in advance

1 Answers

Without any justification given for installing in an environment running an EOL Python, I would recommend creating a new environment. The desired package does not even have a Python dependency.

Also, be sure to follow the Bioconda guidance on channels (conda-forge > bioconda > defaults).

## (optional, but recommended) use mamba
conda install -n base mamba

mamba create -n foo -c conda-forge -c bioconda fastspar

As for the actual error, sounds like you used the free channel ad hoc, but didn't actually add it to the channel configuration or set restore_free_channel configuration setting. I would only do this inside the activated environment with this dated software. Either

Option 1: Add free as channel

## activate the environment, say "foo"
conda activate foo

## add free channel at lowest priority 
## (the `--env` makes it only apply to this environment)
conda config --env --append channels free

## check the configuration
conda config --show channels

This should show the free channel at the bottom of a list. If free is the only channel, then be sure to also --prepend something like defaults.

Option 2: Set configuration

## activate the environment, say "foo"
conda activate foo

## add free channel at lowest priority
conda config --env --set restore_free_channel true

Be sure to always activate this environment before installing in it. Though, again, any environments running old software should be regarded as legacy, i.e., leave it alone, and only use it to run old code.

Related