Reputation: 231
Im trying to run a python script in an Azure pipeline, but it doesnt seem to be working. It keeps telling me 'python' is not recognized as an internal or external command, operable program or batch file.
I have installed python and added it to the path, when I type python
in the command line on the VM it works:
But when I try to run the following command line task in the pipeline, it fails:
- task: CmdLine@2
inputs:
script: 'python ./tools/setPythonClientVersion.py $(Build.BuildNumber)'
displayName: Set Client Version
I get the following error:
Any idea as to why this is happening?
Upvotes: 1
Views: 1158
Reputation: 1018
I encountered a similar issues and solved it by adding the python interpreter argument to the yaml. Something like this:
- task: PythonScript@0
displayName: Set Client Version
inputs:
scriptSource: inline
script: |
# add your script here
pythonInterpreter: 'c:/python/python.exe'
Upvotes: 1