Cannot install psychopy through pip on MacOS M2

Hi everyone,

I want to use “pip install psychopy” on MacOS M2, but the error messages below keep showing:

I have already tried several methods regarding to HDF5 (like using homebrew to install then change the path), but nothing worked.
Does everyone here encounter the same problem? Or does any of you have any suggestions?
Thank you very much!

For anyone encountering this in future. I ran:

brew install hdf5


export HDF5_DIR=/opt/homebrew/Cellar/hdf5/1.14.3/


pip3 install psychopy

and this worked! Try to find the location of your H5public.h file to replace the path in the export line

1 Like