Hi all,
I'm trying to create a conda environment through a .yml file that has all the required dependencies for a certain project but I run into environment conflicts. I figured out the source of this conflict, which stems from two specific dependencies, but for some reason, creating an environment with these dependencies alone doesn't lead to an error, but does when I run it with all the other dependencies.
Here's what I mean:
This is my .yml file for the environment I want to create.
name: master
channels:
- r
- bioconda
- conda-forge
- defaults
dependencies:
- bedtools=2.30.0
- htseq=2.0.2
- samtools=1.16.1
- r-base=4.2.2
- r-dplyr=1.0.10
- r-ggplot2=3.4.0
- r-ggridges=0.5.4
- r-biocmanager=1.30.19
- bioconductor-rsamtools=2.14.0
- bioconductor-rsubread=2.8.1
- bioconductor-deseq2=1.38.0
- bioconductor-biocgenerics=0.44.0
- bioconductor-genomicalignments=1.34.0
- bioconductor-genomicranges=1.50.0
After running the code conda env create -f .yml
it leads to an error basically stating
Found conflicts! Looking for incompatible packages.
The packages that I've determined are the issue are samtools and rsubread. When I run a subset of the .yml file without them, it works. When I run a .yml file with only samtools and rsubread, that also works. So I don't know why its creating a conflict. Both of the .yml files below work.
name: testingenv1
channels:
- r
- bioconda
- conda-forge
- defaults
dependencies:
- bedtools=2.30.0
- htseq=2.0.2
- r-base=4.2.2
- r-dplyr=1.0.10
- r-ggplot2=3.4.0
- r-ggridges=0.5.4
- r-biocmanager=1.30.19
- bioconductor-rsamtools=2.14.0
- bioconductor-deseq2=1.38.0
- bioconductor-biocgenerics=0.44.0
- bioconductor-genomicalignments=1.34.0
- bioconductor-genomicranges=1.50.0
name: testingenv2
channels:
- r
- bioconda
- conda-forge
- defaults
dependencies:
- samtools=1.16.1
- bioconductor-rsubread=2.8.1
I've tried searching the web for my own solution to no avail. I've even tried package clients like mamba instead of conda since I've heard that conda's error reporting is pretty bad, but mamba leads to other issues.
Any help would be appreciated!
Do you really need these specific versions of all packages? Can you change some
=
to>=
or even drop reliance on specific version numbers entirely?Good idea. I'll see which ones I can drop reliance to. Thanks!
For future use, you can either run
conda env export --from-history > myenv.yml
orconda env export --no-builds > myenv.yml
to export your environment configuration without the build information. This may help you avoid conflicts in the future.