My Jenkins is using python 2.7 to execute python scripts. But I want to execute the script using python 3.7. So far I have done something like this.
test.py
#!/home/sam/python/python3/bin/python3.8
import sys
print(sys.version)
I am executing this script with python test.py. In output I am getting python version 2.6. Can anyone suggest how can I run the python script with python 3.7 path.
test.py
, and NOTpython test.py
. You need to usepython3 test.py
(or/full/path/to/python3 test.py
). – 0x5453