Search code examples
python-2.7dependenciescondapython-3.6snakemake

Snakemake Salsa2 CreateCondaEnvironmentException with python 2.7. and openssl


I´m trying to integrate Salsa2 into my workflow. Since this tool runs on python 2.7 I definitely want to create a separate conda environment for this purpose. My yaml file looks like this:

channels:
  - conda-forge
  - anaconda
  - bioconda

dependencies:
  - python = 2.7.18
  - salsa2 = 2.3.
  - boost = 1.70.0
  - boost-cpp = 1.74.0
  - networkx = 1.11

However when I run my code snakemake --use-conda --cores 15 I receive the following error:

Creating conda environment envs/salsa2.yaml...
Downloading and installing remote packages.
CreateCondaEnvironmentException:
Could not create conda environment from /buffer/path/to/my/assembly_downstream/workflow/rules/../envs/salsa2.yaml:
Command:
mamba env create --quiet --file "/buffer/path/to/my/assembly_downstream/workflow/.snakemake/conda/bf0438d2754e7799a3cb353c72e2ed4b.yaml" --prefix "/buffer/path/to/my/assembly_downstream/workflow/.snakemake/conda/bf0438d2754e7799a3cb353c72e2ed4b"
Output:
Encountered problems while solving:
  - nothing provides openssl >=1.1.1,<1.1.2.0a0 needed by python-3.6.7-h0371630_0

The simple solution would probably be to add openssl 1.1.1 to my yaml. Like this:

channels:
  - conda-forge
  - anaconda
  - bioconda
dependencies:
  - python = 2.7.18
  - salsa2 = 2.3.
  - boost = 1.70.0
  - boost-cpp = 1.74.0
  - networkx = 1.11
  - openssl = 1.1.1

But this fixes nothing and I still receive the error. Creating this exact environment manually works as expected, therefore I guess it's a conflict with snakemake since it runs on python3. But my normal snakemake environment is properly configured and I thought the conda envs are only used for separated rules? Does anyone know what could cause this error?


Solution

  • There's no reason to be specifying anything other than salsa2 to get a working environment. The following works for me on both osx-64 and linux-64.

    salsa2

    salsa2.yaml

    name: salsa2
    channels:
      - conda-forge
      - bioconda
      - nodefaults
    dependencies:
      - salsa2=2.3
    

    For the record, the linux-64 version yields the following solution

    name: salsa2
    channels:
      - conda-forge
      - bioconda
      - defaults
    dependencies:
      - _libgcc_mutex=0.1=conda_forge
      - _openmp_mutex=4.5=2_gnu
      - boost-cpp=1.74.0=h75c5d50_8
      - bzip2=1.0.8=h7f98852_4
      - ca-certificates=2022.6.15=ha878542_0
      - certifi=2019.11.28=py27h8c360ce_1
      - decorator=4.4.2=py_0
      - icu=70.1=h27087fc_0
      - ld_impl_linux-64=2.36.1=hea4e1c9_2
      - libffi=3.2.1=he1b5a44_1007
      - libgcc-ng=12.1.0=h8d9b700_16
      - libgomp=12.1.0=h8d9b700_16
      - libsqlite=3.39.2=h753d276_1
      - libstdcxx-ng=12.1.0=ha89aaad_16
      - libzlib=1.2.12=h166bdaf_2
      - ncurses=6.3=h27087fc_1
      - networkx=1.11=py27_0
      - openssl=1.1.1q=h166bdaf_0
      - pip=20.1.1=pyh9f0ad1d_0
      - python=2.7.15=h5a48372_1011_cpython
      - python_abi=2.7=1_cp27mu
      - readline=8.1.2=h0f457ee_0
      - salsa2=2.3=py27h16ec135_1
      - setuptools=44.0.0=py27_0
      - sqlite=3.39.2=h4ff8645_1
      - tk=8.6.12=h27826a3_0
      - wheel=0.37.1=pyhd8ed1ab_0
      - xz=5.2.6=h166bdaf_0
      - zlib=1.2.12=h166bdaf_2
      - zstd=1.5.2=h6239696_4
    prefix: /usr/share/miniconda/envs/salsa2