-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to build from source on MacOS 11 + M1 #1810
Comments
What's the value of |
|
That's an interesting result. Maybe upstream Python needs an enumeration added for |
Sorry, I don't follow what you're suggesting -- can you clarify? At a glance, the current results from the |
I think to fix this we'll need more specific rules for when to use what version of numpy, like in oldest_supported_numpy or in scipy. In the meantime, you can work around it by following the steps for development installation to build with an already-installed numpy rather than creating a temporary build environment. |
I was mistaken and didn't see that So please disregard! |
Sorry to reopen an old issue, but I had this same problem trying to install h5py and I think I came up with a bit of dirty fix. More than happy for someone to point out a more elegant fix. The issue for me at least seemed to be with numpy 1.19.3 failing to build. With homebrew numpy 1.20.3 is available, but even with that install the build for h5py will try and build 1.19.3. By cloning the current master, then bumping the numpy version to 1.20.3 in setup.py, this seemed to get round the issue. This may have some side effects, but at least it works for now. |
I found an alternative solution: HDF5_DIR=/opt/homebrew/opt/hdf5 pip3 install --no-build-isolation h5py |
@WillTrojak Your fix worked! I also needed to do |
Just to note, the HDF5_DIR environment variable is documented here ('To specify where to find HDF5'): https://docs.h5py.org/en/stable/build.html#custom-installation |
This should be fixed now, in that it should get a supported version of NumPy when it tries to build. We don't have pre-built Mac ARM wheels yet, so it will still need to build from source. |
My understanding is that without the prebuilt arm wheels, Do we have a plan to upload pre-built arm wheels? |
I have found that pip install only works if you have installed hdf5 separately first on the Mac M1. Steps:
|
@rainwoodman that's right, yes. The wheels include a copy of HDF5. @matham just added wheels for ARM Macs in #2065 (and a couple of follow up PRs), so we'll hopefully upload these with the next release. |
Thanks for the prompt update! |
good |
Attempting to install
h5py
viapip
fails for ARM Macs; there is no prebuilt wheel for this platform, so pip attempts to build h5py from source. However, this fails because it attempts to use Numpy 1.19.3 (when on Python 3.9), but Numpy 1.19.3 does not build on M1 Macs out of the box (build log: h5py_build_fail.log).If you modify
setup.py
so thath5py
builds against Numpy 1.20.1 instead (which works on M1 Macs), h5py builds successfully.Dumb example patch that fixes the build but isn't intended to be actually merged:
The text was updated successfully, but these errors were encountered: