Wasn't there a nice set of instructions for visual studio somewhere?

I don’t want to contribute to cpython yet, just build modules. I thought I saw some instructions before but I can’t find them again.

These days, you should just be able to install Visual Studio (select the C compiler, obviously…) and it will get picked up automatically. IIRC, the old instructions were for previous versions which were much trickier to set up.

If you still have problems, I suggest you describe what you’ve done and what went wrong, as that will help people advise you.

2 Likes

Much appreciated. I’ll do as you suggest.

For reference, vs2022 is really weird about this. I successfully created a new project once, but the second time I went to do it the search function didn’t find the option.

I know, an M$ product not behaving as expected. Positively shocking.

Thanks again
Joe

On Windows, I now prefer to build Python with a command line: PCbuild\build.bat -e -d -p x64:

  • -e: install dependencies
  • -d: build in debug mode
  • -p x64: build for x86-64 arch (Intel 64 bits)

For me, it’s faster than having to load Visual Studio and use my mouse to click on “build” (and select the right options).

That’s for building Python. For building extensions (which is what the OP asked about) setuptools should automatically detect a correctly-installed copy of Visual Studio with no further configuration needed.

Oh. To build C extensions, you don’t need a whole Visual Studio, but just the Windows SDK to get a C compiler and Windows header files, no?

Possibly, but that is fiddly to set up I think. It’s much easier to just install Visual Studio - the free version is fine.