Skip to content

LALSuite causes h5py 3.15 import failure on macOS

With h5py 3.15.0, importing lal before h5py causes the latter to fall over immediately.

Consider the following example:

$ uname -a
Darwin builder-osx-6.ligo.org 24.6.0 Darwin Kernel Version 24.6.0: Mon Aug 11 21:14:08 PDT 2025; root:xnu-11417.140.69.701.11~1/RELEASE_ARM64_T8103 arm64
$ sw_vers
ProductName:            macOS
ProductVersion:         15.7
BuildVersion:           24G222
$ uv venv --seed --python 3.11
Using CPython 3.11.14
Creating virtual environment with seed packages at: .venv
✔ A virtual environment already exists at `.venv`. Do you want to replace it? · yes

 + pip==25.2
 + setuptools==80.9.0
 + wheel==0.45.1
Activate with: source .venv/bin/activate
$ .venv/bin/python --version --version
Python 3.11.14 (main, Oct 10 2025, 12:55:50) [Clang 20.1.4 ]
$ .venv/bin/python -m pip install -U pip
Requirement already satisfied: pip in ./.venv/lib/python3.11/site-packages (25.2)
$ .venv/bin/python -m pip install h5py==3.15.0 lalsuite
Collecting h5py==3.15.0
  Downloading h5py-3.15.0-cp311-cp311-macosx_14_0_arm64.whl.metadata (3.0 kB)
Collecting lalsuite
  Downloading lalsuite-7.26.1-cp311-cp311-macosx_12_0_arm64.whl.metadata (3.2 kB)
...
$ .venv/bin/python -m pip list
Package           Version
----------------- --------------------
astropy           7.1.1
astropy-iers-data 0.2025.10.13.0.37.17
contourpy         1.3.3
cycler            0.12.1
fonttools         4.60.1
h5py              3.15.0
igwn-ligolw       2.1.0
igwn-segments     2.1.0
kiwisolver        1.4.9
lalsuite          7.26.1
lscsoft-glue      4.1.1
matplotlib        3.10.7
numpy             2.3.3
packaging         25.0
pillow            11.3.0
pip               25.2
pyerfa            2.0.1.5
pyparsing         3.2.5
python-dateutil   2.9.0.post0
PyYAML            6.0.3
scipy             1.16.2
setuptools        80.9.0
six               1.17.0
tqdm              4.67.1
wheel             0.45.1
$ .venv/bin/python -c "import h5py; import lal"
$ .venv/bin/python -c "import lal; import h5py"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/duncanmacleod/tmp/.venv/lib/python3.11/site-packages/h5py/__init__.py", line 45, in <module>
    from ._conv import register_converters as _register_converters, \
  File "h5py/_conv.pyx", line 1, in init h5py._conv
  File "h5py/h5r.pyx", line 1, in init h5py.h5r
  File "h5py/h5p.pyx", line 1, in init h5py.h5p
  File "h5py/h5t.pyx", line 152, in init h5py.h5t
  File "h5py/h5t.pyx", line 86, in h5py.h5t.lockid
  File "h5py/h5t.pyx", line 55, in h5py.h5t.typewrap
RuntimeError: Not a datatype (not a datatype)

The same result occurs with Pythons 3.12 and 3.13 as well.