When I call Python script from shell script, it runs fine.
python script.py
But after I pulled the same script from Gerrit and then added code for calling Python script, then it gave me the below error :
./script.sh: line 126: python: command not found
Looks like path problem.
Use which python in terminal to find your python path first. In my case it's in /usr/bin
$ which python
/usr/bin/python
Then add the python path to path variable in your script.sh, e.g. put the following line in any place before you call python.
PATH+=:/usr/bin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With