Psychopy on Big Sur on mac

Does the latest version of psychopy work with the updated mac os Big Sur? Mine seems to be crashing at startup and haven’t been able to launch any of my scripts.

@Jon Gives some instructions here: Release 2020.2.3 fixing launch issues for macOS Catalina/Mojave. It appears that the issue has something to do withA piece of background software called piglet.He writes:

Fetch your open copy of pyglet/window/key.py:
https://github.com/pyglet/pyglet/blob/pyglet-1.5-maintenance/pyglet/window/key.py and save it inside psychopy/app/builder/

Then change psychopy/app/builder/validators.py around line 27 from

from pyglet.window import key

to

try:
    from pyglet.window import key
except Exception:
    from . import key

Hopefully then you can launch the app"

Unfortunately, I lack the technical skills to follow this instruction, Because I don’t know how to access the directory “`psychopy/app/builder/”.

I think if you follow the instructions above you should have solved the problem, can anyone point me to how to access this directory?

1 Like

To access psychopy/app/builder/validators.py, you need only need to right click the psychopy icon in Applications folder, then choose ‘Show package contents’.

After I made these changes, Psychopy did started up ‘normally’. But there were still a lot of issues, and I moved to Windows.

Thanks for the replies. Most probably reverting back to Catalina then.

As a person with a physical disability,I have decided that the best approach for me is to use VMWare to run the software in Windows.This is because I definitely need the new accessibility features. It is also worth pointing out that when the next generation of MacBooks are released, there will be no option for people to revert OS. It should therefore be important to eventually try to ensure compatibility between Big Sur and Psychopy.

I am very sorry, doing this the first time as well and am kind of a beginner…
How do I find “psychopy/app/builder/validators.py”?

That path seems to have changed, I think to fit with new requirements from Apple for signing applications. I think you can find the file you are after now at:

/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/validators.py

Thank you so much!

I tried to start PsychoPy after finishing the Big Sur Update. That’s what I got (and want to share):

Traceback (most recent call last):
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/init.py“, line 378, in getattr
AttributeError: ‚NoneType‘ object has no attribute ‚_create_shadow_window‘

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File „/Applications/PsychoPy.app/Contents/Resources/boot.py“, line 498, in
File „/Applications/PsychoPy.app/Contents/Resources/boot.py“, line 476, in _run
File „/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py“, line 104, in
File „/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py“, line 100, in main
File „/Applications/PsychoPy.app/Contents/Resources/psychopyApp.py“, line 28, in start_app
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/_psychopyApp.py“, line 226, in init
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/_psychopyApp.py“, line 262, in onInit
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/init.py“, line 7, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py“, line 46, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/dialogs/init.py“, line 28, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/validators.py“, line 27, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/window/init.py“, line 1896, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/init.py“, line 384, in getattr
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/gl/init.py“, line 100, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/gl/lib.py“, line 141, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/gl/lib_agl.py“, line 49, in
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/lib.py“, line 118, in load_library
File „/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/pyglet/lib.py“, line 286, in load_framework
ImportError: Can’t find framework /System/Library/Frameworks/OpenGL.framework.

With the patch I can launch psychopy…

however I’m unable to launch an expe… even with just one routine with a basic text component… It says it’s running… but nothing…

1 Like

Same here. I’ve applied the patch to validators.py and saved key.py inside …/psychopy/app/builder.

Error:

dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: /Applications/PsychoPy.app/Contents/MacOS/python
  Reason: image not found

On Big Sur CoreFoundation seems not located in the folder /System/Library/Frameworks/CoreFoundation.framework/Versions/A/

I applied the patch to validators.py (but I did not see instructions about how to change saved key.py inside–should I do that too?). I still cannot get PsychoPy to load in Big Sur. I do notice the following error in the console window just after the crash: “Nov 16 11:31:22 Synapse com.apple.xpc.launchd[1] (application.org.psychopy.PsychoPy3.12922165779.12922165918[17241]): Service exited with abnormal code: 255”.

Any suggestions are welcome, though I unfortunately don’t have the flexibility of downgrading back to Catalina, where PsychoPy was working well.

OK, it looks like Apple have changed the structure of their framework folders (which has broken OpenGL access from Pyglet). https://github.com/pyglet/pyglet/issues/274

I do now have a Big Sur virtual machine to work on to investigate whether the suggested fix there is going to work for us

2 Likes

OK. I’m making some progress here.

Getting PsychoPy to load: The solution by @TarandeepKang solves the problem by not loading pyglet (which won’t be a solution in the long run). The pyglet team have posted some fixes to the top of their 1.5-maintenance branch and using that gets PsychoPy loading again without the hack to validators.

But the issue @walter raises, with CoreFoundation not being found, is the next one to crack. That occurs even if we try to launch a script that does nothing, so it seems to be something in the script-launching process within PsychoPy app

I have actually uploaded a testing release called 2020.2.7rc1 with the first step applied (where PsychoPy should launch but cant yet run scripts on Big Sur)

New release of pyglet (v1.5.11) should fix issue with CoreFoundation. Furthermore, it should prevent future issues with finding libraries.

I don’t think they’ll fix this one:

dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  Referenced from: /Applications/PsychoPy.app/Contents/MacOS/python
  Reason: image not found

because I’m getting that even if I launch a script that contains no pyglet calls (just print('hello'))

some potential useful info here about changes in Big Sur
https://github.com/nyholku/purejavahidapi/issues/75

OK, some more positive news… I’ve just had a working setup on Big Sur where I made only the following tweaks:
https://github.com/psychopy/psychopy/pull/3309/commits/f0d3533e19b5f03d4b7a93e79ecd87b5b392750d

That was based on Python 3.8 installed from python.org so we might yet have trouble when we port that into the Standalone app bundle (which so far has been built on Py3.6) but fingers crossed it means we should be able to get something working soon!

OK, there’s now a test release availabe that I think works fine on Big Sur on everything except for the new TextBox (I have the fix for that implemented as well but it requires rebuilding the binaries)

Hopefully 2020.2.7 final will be out this afternoon with full Big Sur support back in

1 Like