Reputation: 65
i am new to Azure DevOps and have been trying to run a simple task in azure-pipelines.yml CI pipeline.
- stage: Test
jobs:
- job: Pytest
displayName: Pytest
pool:
vmImage: ($vmImageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- bash: pytest
- bash: find ./tests/ -type f -name "*.py" | xargs pylint --jobs=2
However, i get the error for the task UsePythonVersion and also for Bash :
A task is missing. The pipeline references a task called 'UsePythonVersion'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 0, job 'Pytest', step ''.)
A task is missing. The pipeline references a task called 'Bash'. This usually indicates the task isn't installed, and you may be able to install it from the Marketplace: https://marketplace.visualstudio.com. (Task version 0, job 'Pytest', step ''.)
I tried looking for these on the Marketplace as well, but no clue. Any leads here would be helpful
Upvotes: 2
Views: 4664
Reputation: 65
Thanks, actually the case was that Disable built-in tasks in organization Settings was enabled. One can find it in Organizations Setting - > Pipelines -> Settings -> Tasks Restrictions -> Disable built-in tasks
Upvotes: 2
Reputation: 9208
The task's own documentation says:
Prerequisites
- A Microsoft-hosted agent with side-by-side versions of Python installed, or a self-hosted agent with Agent.ToolsDirectory configured (see FAQ).
This task will fail if no Python versions are found in Agent.ToolsDirectory. Available Python versions on Microsoft-hosted agents can be found here.
Perhaps your agent does not have those prerequisites?
Upvotes: 0