Hey Muhammad,
The pythons that are available to you are the ones that the container can see. This is based on finding the executable called "python" on your $PATH. So if your container binds a path on your host (somewhere in $HOME) where python is installed, you can run that python from the container. If you don't bind a location (for example, /opt/python on your host) then you cannot use it. Once you have "hit" a particular executable, the modules are then found based on the $PYTHONPATH. So, if you want to do this:
What (I think) you really want to do is execute the command to the container using some java within the container, or on the host? Remember, if the path on the host with java is not see-able by the container, or if the container doesn't have its own java, this won't work.
singularity exec test.simg java -jar /scripts/somescript.jar
If you have java on the host AND container then you likely want to be sure you are hitting the right one:
singularity exec test.simg which java
The same goes for python. You need to execute the command to the container to run python, python executing a singularity container doesn't make sense.
singularity exec test.simg python /scripts/somescript.py
singularity exec test.simg which python
Does the help?
Best,
Vanessa