Skip to content

[BUG] Windows + Conda - Code compilation errors due to VS code / vcvarsall.bat -> interrogate registry swap #4664

Open
@mrmundt

Description

@mrmundt

setuptools version

setuptools>=74

Python version

All tested versions; distributed with conda (3.9-3.12)

OS

Windows

Additional environment information

Issue only occurs on windows+conda; we do not see it on windows+pip

Description

With the recent upgrade of setuptools, one of our project's extension builds (specifically with conda) is now failing with the error:

**** Building APPSI ****
Building in 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpyzw9baoa'
ERROR: DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is
required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/

If we downgrade to setuptools<74 or we use pip instead of conda, we do not have this issue.

Expected behavior

We expect the compilation to run / build / not hit a "version required is not available" error.

How to Reproduce

There are a lot of steps to reproduce this because it happens significantly later in the CI process:
https://github.com/mrmundt/pyomo/actions/runs/11109169438/job/30863888315

The basic steps, though, are:

  1. Install miniconda for appropriate windows version
  2. Install dependencies through conda
  3. Install pyomo - pyomo setup.py develop
  4. Run download and build extensions:
        pyomo download-extensions 
        pyomo build-extensions # this is where the error occurs

Output

**** Building APPSI ****
Building in 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpyzw9baoa'
ERROR: DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is
required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Simplified ReproducerA simplified (ideally minimal) reproducer needs to be provided so that investigation may proceedbug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions