.yml file not being read when running apptainer container

67 Views Asked by At

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.

0

There are 0 best solutions below