I followed the Microsoft guidance on installing a self-hosted build agent for Windows on my local machine. The agent is running and responsive and can successfully execute all task steps preceding point of failure.
The failing task is UsePythonVersion@0
task which is defined as such below:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
addToPath: true
architecture: 'x64'
The error raised when build is executed:
##[error]Version spec 3.10 for architecture x64 did not match any version in Agent.ToolsDirectory.
I configured the agent to run this task as per the steps detailed in the URL. This can be seen in the provided screenshots.
I added user-defined capabilities as per Microsoft guidance which were not picked automatically due to being environment variables
The Python environment target is a virtual one and was installed in place. The Python environment was not on the path so I added it and restarted the Azure Pipelines Agent service. I don't think it needs to be on the path, but I might be incorrect.
Another user had a GitHub issue open and the recommendation was to not specify the Python subversion. I tried this and set versionSpec: '3'
, this did not resolve the error and the message did not change.
I tried restarting the Azure Pipelines Agent service after making changes to the tools_
directory.
Also note that I have not overridden $AGENT_TOOLSDIRECTORY/
.
I referenced this Q/A and tried moving files from the script directory one level up. This did not resolve my issue. I also reinstalled python precompiled into this directory as per the recommendation. That did not resolve the problem either.
I also reinstalled Python 3.10 for all users precompiled C:\Program Files\Python310 and updated the path. I restarted the service and was able to see the new location added to the path in the agent capabilities. I ran the CI pipe again and the same error was returned.
I have removed the step for now and added a user capability to the agent which references the Python installation that I want to use. It seems to be using that installation. This is not satisfactory though.
I don't know what I have missed.