首页 > 解决方案 > 我想创建conda环境:UnsatisfiableError:发现以下规范有冲突:

问题描述

我想使用多个工具/包来构建环境。我的environment.yml文件如下所示

name: myenv
channels:
    - conda-forge
    - bioconda
    - default
dependencies:
    - pip >=19.0
    - fastqc =0.11.8
    - python =3.6
    - h5py =2.9.0
    - htslib =1.9
    - intervaltree =3.0.2
    - matplotlib =2.1.2
    - r=3.5.1
    - bioconductor-deseq2=1.20.0
    - bioconductor-limma
    - bioconductor-edger

当我尝试在snakemake中创建如下环境时,

snakemake --rerun-incomplete --use-conda --conda-prefix /cluster/projects/snakemake_test/envs

它抛出以下错误,

CreateCondaEnvironmentException:
Could not create conda environment from /cluster/projects//workflows-rna_seq_star/rules/../envs/envs.yml:
Collecting package metadata: ...working... done
Solving environment: ...working... failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - matplotlib=2.1.2
  - r=3.5.1

非常感谢任何帮助/建议

标签: rcondasnakemake

解决方案


It appears that matplotlib=2.1.2 depends on:

conda search --info matplotlib=2.1.2

  - cycler >=0.10
  - freetype >=2.8,<2.9.0a0        <<<<<
  - icu >=58.2,<59.0a0
  - libgcc-ng >=7.2.0
  - libpng >=1.6.32,<1.7.0a0
  - libstdcxx-ng >=7.2.0
  - numpy
  - pyparsing
  - pyqt 5.6.*
  - python >=3.6,<3.7.0a0
  - python-dateutil
  - pytz
  - setuptools
  - tk 8.6.*
  - tk >=8.6.7,<8.7.0a0
  - tornado
  - zlib >=1.2.11,<1.3.0a0

r (r-base) 3.5.1 depends on:

conda search --info r-base=3.5.1

  - _r-mutex 1.* anacondar_1
  - bwidget
  - bzip2 >=1.0.6,<2.0a0
  - cairo >=1.16.0,<1.17.0a0
  - curl
  - freetype >=2.9.1,<3.0a0        <<<<<
  - gcc_linux-64 7.*
  - gfortran_linux-64 7.*
  - glib >=2.58.3,<3.0a0
  - gsl >=2.5,<2.6.0a0
  - gxx_linux-64 7.*
  - icu >=58.2,<59.0a0
  - jpeg >=9c,<10a
  - krb5 >=1.16.3,<1.17.0a0
  - libcurl >=7.64.1,<8.0a0
  - libgcc-ng >=7.3.0
  - libgfortran-ng >=7,<8.0a0
  - libpng >=1.6.35,<1.7.0a0
  - libssh2 >=1.8.2,<1.9.0a0
  - libstdcxx-ng >=7.3.0
  - libtiff >=4.0.9,<5.0a0
  - libuuid >=2.32.1,<3.0a0
  - libxml2 >=2.9.9,<2.10.0a0
  - make
  - pango >=1.40.14,<1.41.0a0
  - pcre >=8.41,<9.0a0
  - readline >=7.0,<8.0a0
  - tk >=8.6.9,<8.7.0a0
  - tktable
  - xz >=5.2.4,<5.3.0a0
  - zlib >=1.2.11,<1.3.0a0

and the package freetype is in conflict (the <<<<< are mine). I think you should either find compatible versions of r and matplolib or, if you don't need them in the same snakemake rule, create a separate environment for each.

From a quick search, it seems that matplotlib=2.2.2 or later should be fine.


推荐阅读