r/learnpython • u/tthkbw • 13d ago
numpy build fails using uv and homebrew
I am running macOS 27.2 with homebrew and uv. Python 3.15. numpy is a requirement for the project. When uv tries to build numpy 2.5.1, it fails complaining about not finding "atomic.h", "ostream.h" and "cstddef.h".
I know this is some kind of setup problem with the c++ compiler, but can't figure it out. I have installed Xcode command line tools and pkgconf.
Any suggestions?
3
Upvotes
View all comments
Show parent comment
2
u/seanv507 13d ago
to add to this comment. compiling numpy (or other c++ libraries) from scratch is an 'antipattern'. Don't ever do it, unless explicitly told to in the installation!
So either do as u/Gshuri suggested or run an older version of python consistent with that numpy version (and any other outdated package versions you might run into after solving the numpy issue!). UV is very capable of installing a different python version for that project - it just defaults to the latest.
you might also use claude etc to help updating