Mells
Mells

Reputation: 11

Found conflict while installing packages with conda

I was trying to install trim-galore in my conda enviroment on ubuntu 20.04 and this message appeared, since is the first time I am working with it, I have no idea on how to solve this:

    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.
    Collecting package metadata (repodata.json): done
    Solving environment: failed with initial frozen solve. Retrying with flexible solve.
    Solving environment: / 
    Found conflicts! Looking for incompatible packages.
    This can take several minutes.  Press CTRL-C to abort.
    failed                                                                    
    
    UnsatisfiableError: The following specifications were found
    to be incompatible with the existing python installation in your environment:
    
    Specifications:
    
      - trim-galore -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0|3.4.*']
    
    Your python: python=3.10
    
    If python is on the left-most side of the chain, that's the version you've asked for.
    When python appears to the right, that indicates that the thing on the left is somehow
    not available for the python version you are constrained to. Note that conda will not
    change your python version to a different minor version unless you explicitly specify
    that.
    
    The following specifications were found to be incompatible with your system:
    
      - feature:/linux-64::__glibc==2.31=0
      - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
    
    Your installed version is: 2.31

The command I run was conda install -c bioconda trim-galore and I run that after activated my enviroment.

The version of conda is 4.11.0

Upvotes: 0

Views: 10223

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20629

You have previously specified

python=3.10

for this environment. Most likely while creating it. This has created a pin for this python version. Now when you try to install trim-galore, the issue is that it depends, among others, on cutadapt, for which no version that supports python 3.10 exists:

conda search -c bioconda --info cutadapt=3.7
Loading channels: done
cutadapt 3.7 py37h8902056_0
---------------------------
file name   : cutadapt-3.7-py37h8902056_0.tar.bz2
name        : cutadapt
version     : 3.7
build       : py37h8902056_0
build number: 0
size        : 197 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py37h8902056_0.tar.bz2
md5         : 372ffd8db0a584443d817f2f91b95cdf
timestamp   : 2022-02-23 18:06:03 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.7,<3.8.0a0
  - python_abi 3.7.* *_cp37m
  - xopen >=1.2.0


cutadapt 3.7 py37h8902056_1
---------------------------
file name   : cutadapt-3.7-py37h8902056_1.tar.bz2
name        : cutadapt
version     : 3.7
build       : py37h8902056_1
build number: 1
size        : 197 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py37h8902056_1.tar.bz2
md5         : bb181439876574c985916d94dce49979
timestamp   : 2022-02-25 22:48:07 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.7,<3.8.0a0
  - python_abi 3.7.* *_cp37m
  - xopen >=1.2.0


cutadapt 3.7 py38hbff2b2d_0
---------------------------
file name   : cutadapt-3.7-py38hbff2b2d_0.tar.bz2
name        : cutadapt
version     : 3.7
build       : py38hbff2b2d_0
build number: 0
size        : 201 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py38hbff2b2d_0.tar.bz2
md5         : e38630777b8d17687134aa015ca88385
timestamp   : 2022-02-23 18:01:48 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.8,<3.9.0a0
  - python_abi 3.8.* *_cp38
  - xopen >=1.2.0


cutadapt 3.7 py38hbff2b2d_1
---------------------------
file name   : cutadapt-3.7-py38hbff2b2d_1.tar.bz2
name        : cutadapt
version     : 3.7
build       : py38hbff2b2d_1
build number: 1
size        : 201 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py38hbff2b2d_1.tar.bz2
md5         : c8101ce2f3ffcbca9b3bb2df93a9730f
timestamp   : 2022-02-25 22:44:37 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.8,<3.9.0a0
  - python_abi 3.8.* *_cp38
  - xopen >=1.2.0


cutadapt 3.7 py39hbf8eff0_0
---------------------------
file name   : cutadapt-3.7-py39hbf8eff0_0.tar.bz2
name        : cutadapt
version     : 3.7
build       : py39hbf8eff0_0
build number: 0
size        : 200 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py39hbf8eff0_0.tar.bz2
md5         : 5aaca511ac0bbc132a07a4ee9b1a7a64
timestamp   : 2022-02-23 17:57:41 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.9,<3.10.0a0
  - python_abi 3.9.* *_cp39
  - xopen >=1.2.0


cutadapt 3.7 py39hbf8eff0_1
---------------------------
file name   : cutadapt-3.7-py39hbf8eff0_1.tar.bz2
name        : cutadapt
version     : 3.7
build       : py39hbf8eff0_1
build number: 1
size        : 200 KB
license     : MIT
subdir      : linux-64
url         : https://conda.anaconda.org/bioconda/linux-64/cutadapt-3.7-py39hbf8eff0_1.tar.bz2
md5         : cde0658556fc58ac82a54986971020ad
timestamp   : 2022-02-25 22:41:16 UTC
dependencies:
  - dnaio >=0.7.0
  - libgcc-ng >=10.3.0
  - python >=3.9,<3.10.0a0
  - python_abi 3.9.* *_cp39
  - xopen >=1.2.0

You can also already tell in the error message the list of python versions that conda has found to be compatible

python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0|>=3.5,<3.6.0a0|3.4.*']

With the pin python=3.10 in place, conda cannot downgrade your python version, but there are two simple ways around this:

  • specify python as an installation target: conda install -c conda-forge -c bioconda trim-galore python to allow conda to figure out which python version to change your env to
  • Create a new environment specifying what you need from the beginning: conda create -n tg -c conda-forge -c bioconda python trim-galore

Upvotes: 4

Related Questions