Cant install python 3.9.5 on newer windows images

Since the beginning of February, we are not able to install python 3.9.5 (using choco install python --version=3.9.5) on Windows executors. We haven’t changed anything in the problematic flow, so i dont believe the issue is on our end. We are not seeing this problem for python 3.7.5 nor 3.8.5.

Seems that the build-agent version has changed between working and failing builds.
WORKING AGENTS:

Build-agent version 1.0.105680-924e1373 (2022-01-31T21:01:13+0000)
Build-agent version 1.0.105680-924e1373 (2022-01-31T21:01:13+0000)
Build-agent version 1.0.105865-5dc33656 (2022-02-02T16:12:08+0000)

NOT WORKING:

Build-agent version 1.0.108990-cc4a1c41 (2022-02-18T16:36:23+0000)
Build-agent version 1.0.108990-cc4a1c41 (2022-02-18T16:36:23+0000)
Build-agent version 1.0.108990-cc4a1c41 (2022-02-18T16:36:23+0000)

The failure:
`python v3.9.5 [Approved]
python package files install completed. Performing other installation steps.
The install of python was successful.
Software installed to ‘C:\ProgramData\chocolatey\lib\python’

Chocolatey installed 1/2 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

  • python3 (exited 1603) - Error while running ‘C:\ProgramData\chocolatey\lib\python3\tools\chocolateyInstall.ps1’.
    See log for details.

Exited with code exit status 1
`

Hi @Nave ,
Python version 3.9.7 is installed in the image already, so chocolatey is complaining that you are trying to install an older version on top of it. To use 3.9.7 just run:

py -3.9

Here is a screen shot of the error and how to use the existing version of python 3.9 that is in the image:

Let me know if you need any further help

Thanks!
Michael Rothstein

Ah, that explains it.

Thank you!