I’ve just pip installed psychopy on a 3.8 Python distribution on a fairly recent laptop (2020), with an nvidia GPU and updated drivers.
I’m trying to run this minimal example:
import psychopy.visual, psychopy.core
win = psychopy.visual.Window(size=[800, 600], winType='pygame')
stim = psychopy.visual.Circle(win=win,
units="pix",
fillColor="black",
lineColor="black",
edges=128,
radius=10,
lineWidth=0.5)
stim.draw()
win.update()
psychopy.core.wait(5.0)
win.close()
psychopy.core.quit()
Unfortunately, with the GLFW or pygame backend (pyglet fails at windows creation with NotImplementedError: abstract
), it throws the following error:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\pyglet\media\codecs\wmf.py:838: UserWarning: [WinError -2147417850] Cannot change thread mode after it is set
warnings.warn(str(err))
C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\pyglet\gl\gl_info.py:142: UserWarning: No GL context created yet.
warnings.warn('No GL context created yet.')
C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\pyglet\gl\gl_info.py:122: UserWarning: No GL context created yet.
warnings.warn('No GL context created yet.')
C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\pyglet\gl\gl_info.py:186: UserWarning: No GL context created yet.
warnings.warn('No GL context created yet.')
Traceback (most recent call last):
File "test.py", line 27, in <module>
stim.draw()
File "C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\psychopy\visual\shape.py", line 345, in draw
GL.glActiveTexture(GL.GL_TEXTURE0)
File "C:\Users\Dom\Desktop\WPy64-3860\python-3.8.6.amd64\lib\site-packages\pyglet\gl\lib_wgl.py", line 91, in __call__
raise Exception(
Exception: Call to function "glActiveTexture" before GL context created
Is there anything I can do?