Mac 10.9.5 ModuleNotFoundError: No module named 'PyQt4'

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

OS (e.g. Win10): Mac OS 10.9.5
PsychoPy version (e.g. 1.84.x):
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: run complete experiment/demo

What did you try to make it work?: Tried older versions of PsychoPy. Only much older versions seem to work. Newest version works fine on Windows Laptop. I would like the newer version to work on my Mac OS (10.9.5)

What specifically went wrong when you tried that?:
Include pasted full error message if possible. “That didn’t work” is not enough information.

This is my error message when I try to run anything, even the demos:

Traceback (most recent call last):
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/gui/qtgui.py”, line 15, in
from PyQt4 import QtGui
ModuleNotFoundError: No module named ‘PyQt4’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/labuser/Desktop/psychopy demos/images_blocks/blockedTrials_lastrun.py”, line 14, in
from psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clock
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/gui/init.py”, line 33, in
from .qtgui import *
File “/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/gui/qtgui.py”, line 19, in
from PyQt5 import QtWidgets
ImportError: dlopen(/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/PyQt5/QtWidgets.so, 2): Symbol not found: _LSCopyDefaultApplicationURLForURL
Referenced from: /Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore
Expected in: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
in /Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/PyQt5/Qt/lib/QtCore.framework/Versions/5/QtCore


Thank you

It looks like the version of PyQt we provided is too new for MacOS 10.9:
https://doc.qt.io/archives/qt-5.10/supported-platforms-and-configurations.html

In the next release, I’ll package PyQt 5.8 instead which should be more widely compatible.

Thank you Jon. I think running it off of Pavlovia is a good workable solution in case others have this issue.

1 Like

I’ve just released PsychoPy 3.0.7 where this is fixed for mac (but no change for windows)