Eek. So I have some people doing a longitudinal training study (which is covering a significant period of time) that I created in PsychoPy v1.90.2 (I know, I know - this is ancient now…). Someone’s just updated their OS to Big Sur and they’re now receiving the following error message:
Traceback (most recent call last):
File “/Users/username/Music/Current/Study/Experimentfolder/Experiment.py”, line 2, in
from psychopy import locale_setup, sound, gui, visual, core, data, event, logging
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/ init .py”, line 26, in
from .text import TextStim
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/text.py”, line 28, in
import psychopy.event
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/event.py”, line 63, in
from pyglet.window.mouse import LEFT, MIDDLE, RIGHT
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/window/ init .py”, line 1896, in
gl._create_shadow_window()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/ init .py”, line 384, in getattr
import (import_name)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/gl/ init .py”, line 100, in
from pyglet.gl.lib import GLException
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/gl/lib.py”, line 141, in
from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/gl/lib_agl.py”, line 49, in
framework=’/System/Library/Frameworks/OpenGL.framework’)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/lib.py”, line 118, in load_library
return self.load_framework(kwargs[‘framework’])
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pyglet/lib.py”, line 286, in load_framework
raise ImportError(“Can’t find framework %s.” % path)
ImportError: Can’t find framework /System/Library/Frameworks/OpenGL.framework.
As mentioned in this thread, the issue seems to be with Pyglet and OpenGL. Can anyone recommend a potential way to fix this in such an old version of PsychoPy?
Using this approach as a guide, I can find (both attached):
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/ init .py
/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/visual/textbox/fontmanager.py
But I’m not sure what the equivalent file for ‘visual/textbox2/textbox2.py’ would be? The textbox folder (there isn’t a textbox2 folder) contains only:
init .py
init.pyc
pycache
fontmanager.py
fontmanager.pyc
freetype_bf
parsedtext.py
parsedtext.pyc
textgrid.py
textgrid.pyc
textureatlas.py
textureatlas.pyc
TODO.txt
Also, psychopy/visual/ init.py has very similar code to that in Jon’s example, whereas
visual/textbox/fontmanager.py is quite different:
import math
import numpy as np
import unicodedata as ud
from matplotlib import font_manager
from psychopy.core import getTime
from .textureatlas import TextureAtlas
from pyglet.gl import (glGenLists, glNewList, GL_COMPILE, GL_QUADS,
glBegin, glTexCoord2f, glVertex2f, glEnd, glDeleteLists,
glEndList, glTranslatef, glDeleteTextures)
If this is indeed an approach worth exploring, what edits would you suggest I make to the PsychoPy files to fix this issue? Here are the files themselves: fontmanager.py (18.9 KB) init .py|attachment (2.7 KB)