Is it possible to check the OS compatibility of a conda .yaml file?

Viewed 154

Given a .yaml file such as

channels:
- conda-forge
- bioconda
- rdonnelly
- defaults

dependencies:
#Python
- python
- jupyter_core
- leidenalg
- glpk
- gseapy
- pandas
- scipy

#R
- r-corrplot
- rstudio=1.2.502

Is it possible to automatically check whether any (and which) dependencies are incompatible with the current OS? I often jump from OS to OS between Windows, OSX and Linux, so being able to port environments is important to me.

1 Answers

Automatically? No, not in terms of a built-in CLI option for that purpose. But one could parse out all the package names (e.g., via grep/awk/sed), then check each of them with conda search. The trick to check platform-specific branches in Anaconda Cloud repositories is to use the subdir key for whatever platform you are validating for. For example,

conda search 'leidenalg[subdir=osx-64]'

will check if an OS X version exists for the package on your current channels. If one wanted to strictly check only the channels in the YAML, include the arguments:

-c conda-forge -c bioconda -c rdonnelly -c defaults --override-channels 

to the command.

Related