Errors configuring CPython when using Python Developer's Guide Quick Reference

I am following the Python Developer’s Guide Quick Reference.

I have properly cloned the repository. When I do step 3
./configure --with-pydebug && make -j
I see these messages at the last of the output:

make: *** [Python/frozen_modules/importlib._bootstrap.h] Killed: 9
make: *** Waiting for unfinished jobs....
make: *** [Python/frozen_modules/zipimport.h] Killed: 9
make: *** [Python/frozen_modules/getpath.h] Killed: 9
make: *** [Python/frozen_modules/importlib._bootstrap_external.h] Killed: 9

when I do step 4
./python.exe -m test -j3
I get
zsh: no such file or directory: ./python.exe
so it looks like the ./configure isn’t completing.

I am on MacOS Sonoma 14.6.1 on a machine with 16 Gb RAM.

I’d appreciate any help in pointing me toward where/how I should troubleshoot this.

I’ve tried this on two different MacOS machines with the same results. Following the developer guide works as expected on Linux Mint. I’d still like to figure out the mac issue.

What’s the output when you run make without -j?

@bschubert

When I try it without the -j option I get only one line marked as Killed, but that command still doesn’t complete.

@bschubert

./configure --with-pydebug && make
gets me this

./Programs/_freeze_module getpath ./Modules/getpath.py Python/frozen_modules/getpath.h
make: *** [Python/frozen_modules/getpath.h] Killed: 9

as the last few lines of output. So, better, but not successful.

Is your device active during the entire build process, i.e. does it go into screen saver mode or turn off the display?

If it is permanently active, you need to figure out what else is killing these processes. Maybe memory issues? Do any of the lines before give any interesting information?

You could also try running with the macOS Activity Monitor app to try to get a better idea what’s going on. As noted, system sleep or out of memory issue seem most likely. 16Gb of memory is plenty big (overkill) for a Python build on macOS with the standard Apple Xcode or Command Line Tools.

@MegaIng, the machine and display stay active during the build task. The batch of lines above the two in my last post are just a run of gcc -o with a huge number of .o files listed.

@nad, I ran the

./configure --with-pydebug && make

command with the activity monitor up. Memory usage hovered right around 5.51 GB while the command ran.

The important thing is did it start swapping. But, in any case, I’ve been building Python on all macOS releases of the last 15 years or so, including 14.6.1, and on many different varieties of Macs and Mac VMs and I don’t recall ever running into a situation where a build was terminated by system-generated kills. There’s something very odd going on your system. Try rebooting it and check what else might be running in the background. It is very hard to imagine that this is a Python problem. Sorry I don’t have better suggestions than to treat this as a problem with your macOS systems.

2 Likes

Thanks for the input, @nad. It’s good to find out about successful builds on the same OS. I’ll work on what peculiar is going on with my systems.

1 Like