Help setting up the environment to contribute to CPython

Hi guys. I’m following the Python Developer’s guide to start contributing to CPython as a beginner. I’m stuck upon an issue about setting up the environment and I can’t just understand what’s wrong.
So I have basically forked the CPython repository and I have cloned it on my local pc. Then I followed the instructions on the “Getting Started” section of the guide (I’m on Windows) and I have to verify that all the dependencies required are installed.
So I opened a cmd prompt and entered:
PCbuild\build.bat

It seems like everything is installed correctly, except for this:
Cannot locate MSBuild.exe on PATH or as MSBUILD variable

I’ve searched on Google and found out that I had to add the address of this app to PATH, and I did it. The truth is nothing changed and I still get the same error.

In particular, I added these two addresses:

C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v4.0.30319

(Because I found MSBuild inside those folders)

So, What Am I doing wrong?

Hello and welcome :slight_smile:

It’s been a long time since I’ve gone through this setup process, so I am rather shooting in the dark here. But you shouldn’t have to add anything to PATH yourself. You may need to reboot, or at least reopen cmd.exe for variables set by the Visual Studio installer to appear correctly. Also, make sure you selected everything that looked Python-related in the VS installer, and note that it does need to be Visual Studio 2019, not Visual Studio Code.

1 Like

Another option (depending on your motivation), is to use WSL or Docker and develop under Linux. And if you do happen to be a VS Code user we have a devcontainer defined which should have the tooling ready to go.

Okay, thank you very much, guys.