So if I use
singularity exec -B /autofs qunex_suite-0.91.11.sif bash
And then manually cd to /opt/HCP/HCPPipelines
I get the original Python error (with or without the --cleanenv option given to the above singularity command)
But if I just run the qunex_container command outside the container, I get the second error where it can’t find the PreFreeSurfer directory.
I don’t have a python environment active, but the default python binary on my system is one within a virtual environment that I created with venv.
I noticed on that page you linked that singularity does in fact alter the LD_LIBRARY_PATH variable, though I’m not sure what that means.