# Cannot install psychopy through pip on MacOS M2

**URL:** <https://discourse.psychopy.org/t/cannot-install-psychopy-through-pip-on-macos-m2/35873>\
**Category:** Development\
**Created:** [July 27, 2023, 9:29am UTC](https://discourse.psychopy.org/t/cannot-install-psychopy-through-pip-on-macos-m2/35873 "2023-07-27T09:29:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 17, 2023, 4:34pm UTC](https://discourse.psychopy.org/t/cannot-install-psychopy-through-pip-on-macos-m2/35873/2 "2023-11-17T16:34:44Z")

</div>

For anyone encountering this in future. I ran:

`brew install hdf5`

then

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

then

`pip3 install psychopy`

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

---

_[View the full topic](https://discourse.psychopy.org/t/cannot-install-psychopy-through-pip-on-macos-m2/35873)._
