pypa / pypa/setuptools

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

Open
#4,664 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Simplified Reproducer
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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/

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Windows Conda setup from the linked CI job, then run pyomo setup.py develop, pyomo download-extensions, and pyomo build-extensions. Inspect the setuptools 74+ Windows compiler-detection path described in the title, including the vcvarsall.bat and registry handling. Done means the APPSI extension build completes without the false missing-MSVC error under Conda.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.