Unable to use microphone component on macOS

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): MacOS
PsychoPy version (e.g. 1.84.x): 2021.1.2


I have searched all of the forum topics about this and it seems like it’s been an issue for a couple of years. Wondering if there is a solution as we need to run this experiment on a Mac. When I try to add a microphone component my experiment totally fails. I get the following error message:

File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/sound/backend_pyo.py”, line 30, in
raise exceptions.DependencyError(repr(err))
psychopy.exceptions.DependencyError: ImportError(‘dlopen(/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyo/_pyo.cpython-36m-darwin.so, 2): Library not loaded: @loader_path/libportaudio.2.dylib\n Referenced from: /Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyo/_pyo.cpython-36m-darwin.so\n Reason: image not found’,)

I know other people have had this same issue but there doesn’t seem to be any solution? Has this been resolved? Should I downgrade my psychopy or is there a modification to the local code I can make?

Thank you!

I think this is an issue with the pyo library not successfully packaging all its files in the macOS app bundle because of new security steps on macOS (it requires all executable code to be code-signed and some of the pyo files were not compatible with the modern code-signing). In the summer release this year we’ll be releasing a much-improved Microphone Component using a different backend that will run on macOS as well (the PTB engine that has better timing too).

I’m afraid, for now, you’ll need to use windows/linux for mic recordings

Okay thank you Jon!