Python script used by bash script not found

In my nextflow process named Predict the predict.sh script calls the read_json.py script. The issue is that the read_json.py file (that I have stored in bin and made executable) is not found. What might be the problem?
Later, as expected, based on the instructions in the predict.sh, the data directory all_models is found empty and causes python to exit the program.

ERROR ~ Error executing process > 'Predict (1)'

Caused by:
  Process `Predict (1)` terminated with an error exit status (1)


Command executed:

  predict.sh data.json weights.ckpt
  
  cat <<-END_VERSIONS > versions.yml
      "Predict":
          python: $(python --version 2>&1 | sed 's/Python //g')
  
      END_VERSIONS

Command exit status:
  1

Command output:
  Directory all_models is empty.

Command error:
  python: can't open file 'read_json.py': [Errno 2] No such file or directory
  Directory all_models is empty.

Hi Rea,
Welcome to community.
Have you tried passing absolute path?
If not try doing that it might work.

Fury