0

When running these two commands sequentially in a terminal,

singularity run /home/___/singularity_containers/singularity_container.simg bash
python3 /home/__/__/___/src/python_file.py

Everything executes correctly, but when trying to run this from a batch file with

singularity exec /home/__/singularity_containers/singularity_container.simg python3 /home/___/____/____/src/python_file.py

I get an error, "cannot open shared object file: No such file or directory" for a specific backend library required in my project.

Why does it run in the first case but not in the second? Are the commands not supposed to be doing the same thing?

  • "singularity exec" requires `/bin/sh` inside the container. Do you have it? ([link](https://github.com/apptainer/singularity/issues/2386)) – harrymc Dec 22 '22 at 17:33
  • @harrymc "whereis sh" gives /usr/bin/sh, so it seems to be installed if I'm not misunderstanding you. This is the exact error I get, "ImportError: libcoppeliaSim.so.1: cannot open shared object file: No such file or directory" but it's found If I run the script interactively from within the singularity prompt, but not with exec. – jgklsdjfgkldsfaSDF Dec 22 '22 at 21:37
  • My link says that `/bin/sh` is referenced directly for "singularity exec". Try adding `/bin` to the image. – harrymc Dec 23 '22 at 08:46

0 Answers0