[BUG] Windows + Conda - Code compilation errors due to VS code / vcvarsall.bat -> interrogate registry swap
Nobody has claimed this yet.
- 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:
- Install miniconda for appropriate windows version
- Install dependencies through conda
- Install pyomo -
pyomo setup.py develop - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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