so I have a python program that invokes singularity exec on a .sif file via os.system. Then on the next line of my program, I use os.system again to attempt to run a python script.  I assumed that this would start up the singularity, and then run my script from it, however currently it just runs the exec command, brings me into the container, and then hangs (it does not execute the python command).
Does anybody have any advice or experience with this issue?
Thank you.
Singularity exec runs a single, specified command, it does not change the execution environment to that of the singularity image.
If you need an interactive session, use: singularity shell my_image.sif
If you need to run multiple commands, write a shell script and use that: singularity exec my_image.sif my_script.sh
Alternatively, use singularity to run your python script. Then everything will be done in the context of the image rather than the host machine.
executing os.system python commands after invoking a singularity exec command via os.system