Home > Back-end >  Create a conda environment from a YAML file with perl packages
Create a conda environment from a YAML file with perl packages

Time:11-05

I´m working on Ubuntu. I´ve created a pipeline that needs to have a conda environment with some Python packages and Perl5 with some packages.

I got the python packages and Perl5 via conda and installed the Perl packages with perl-app-cpanminus a conda package.

Now I did like to distribute my pipeline to other people and want to give them as less preparation time as possible to run it, therefore I want to save and export the environment file as YAML. I know how to do this with conda packages but I was wondering if I could in any way include the Perl packages too? Like you do with pip for example:

channels:
  - bioconda
  - conda-forge
  - anaconda
dependencies:
  - pandas
  - pip:
      - pip_package1
      - pip_package2

CodePudding user response:

If it's a Conda package, then it would be another dependency.

channels:
  - bioconda
  - conda-forge
  - anaconda
dependencies:
  - python=3.10  # always specify a Python version (through minor)

  ## Conda Python pacakges
  - pandas
  
  ## PyPI Python packages
  ## note: only use if not available through Conda
  #- pip:
  #    - pip_package1
  #    - pip_package2

  ## Perl packages
  - perl-app-cpanminus

Otherwise, Pip is a special case - Conda does not have any direct support for side-loading via other package managers. This is discussed a bit in this answer.

  • Related