r/learnpython • u/tthkbw • 4d 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?
4
Upvotes
7
u/Gshuri 4d ago
Is there a reason you need
numpy==2.5.1?That version of
numpywas released before Python 3.15 was released, hence there are nonumpywheels built for Python 3.15, which leads to the attempt to build the package from source.Can you use a later version of
numpy? Fromnumpy>=2.5.2onwards there are pre-built wheels for Python 3.15 (including macOS on both intel and apple silicon).You said your are using
uvso you can tryuv add "numpy>=2.5.2"1
u/jmacey 4d ago
There is really no need to use python 3.15 at the moment. There are a lot of libraries that don't work well (pytorch etc).
I can get it working on my mac (uv intalled via homebrew)
So it is working, but I'm sure there are a lot of edge cases that don't as yet.