0

I have an apptainer .def file:

Bootstrap: docker
From: continuum/miniconda3

%files
    env.yml

%post
    conda env create -n envname --file env.yml

%runscript
    source activate envname
    python3 pythonScript.py

It builds successfully, but when I try and run the .sif file, I get ModuleNotFoundError: No module named 'h5py , even though h5py is inside env.yml. I'm assuming the same would happen with the other dependencies within env.yml too.

Is there a reason as to why h5py is not being found? Have I included env.yml incorrectly?

I've also tried giving an absolute path to env.yml, yet that doesn't work either.

Anthon
  • 69,918
  • 32
  • 186
  • 246
  • What happens if you change the last line to `conda run -n envname python pythonScript.py` – FlyingTeller Jul 14 '23 at 12:47
  • You tagged this [tag:yaml], but the [YML](https://fdik.org/yml/) format looks completely different from the [YAML](https://yaml.org/spec/1.2/spec.html) format. The officially recommended file extension for files containing YAML documents has been `.yaml` since at least September 2006 (several years before `conda` came into existence). – Anthon Jul 14 '23 at 12:52

0 Answers0