Visual C++ 9.0 for Python 2.7?

I’m moving to Actions from AppVeyor for my Python project ( I still support Python 2.7 for the moment, and I have C code that needs to be compiled. The compilation fails with:

BuildFailed: Microsoft Visual C++ 9.0 is required. Get it from

What can I do to make this work in GitHub Actions?

I found this solution, which works:

      - name: "Install Visual C++ for Python 2.7"
        if: runner.os == 'Windows'
        run: |
          choco install vcpython27 -f -y