| Reference | Downloads | Github

Not implemented error


I am getting a “not implemented error” for configs=self.get_matching_configs(template) when trying to get Psychopy version 1.84 going on my Windows 7 machine. Any suggestions?


I think the fix is that you can replace super(etc.) with super() when going from python 2 to python 3.


And that actually did not fix it.


Paste in the whole error message to give us a chance, and brief snippets of any relevant code. Nobodya can help with your current level of detail.


Hi Jon,

Thank you for the reply.

I think the problem is at _get_pixel_format_descriptor_matching_configs(self, canvas):, which gets matching configs using the PIXELFORMATDESCRIPTOR technique.

I can comment pf and return [] at the end of the
_get_pixel_format_descriptor_matching_configs def, but I think that bypasses the problem, and leads to the error that I showed you yesterday.

The problem is that I can not find the PIXELFORMATDESCRIPTOR info. I can set up a PIXELFORMATDESCRIPTOR structure, but byrefs expects a ctype instance. Converting a structure to a ctype is complicated, so I am lost.

The error message is below (1), and the relevant code is below that (2).

Thank you for your help,


  1. Error message

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\python-3.5.3.amd64\lib\site-packages\spyder\utils\site\”, line 102, in execfile

File “C:/Users/1523053295E/Desktop/WinPython-64bit-”, line 18, in
disp = window(size=DISPSIZE, units=‘pix’, color = BGC, fullscr=False)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\visual\”, line 343, in init

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\visual\”, line 1552, in _setupGL

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\visual\”, line 1378, in _setupPyglet
defDisp = psychopy.pyglet.window.get_platform().get_default_display()

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\”, line 357, in getattr

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\”, line 1818, in

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\”, line 205, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\window\”, line 131, in init
super().init(*args, **kwargs)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\”, line 506, in init
config = screen.get_best_config(template_config)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\canvas\”, line 161, in get_best_config
configs = self.get_matching_configs(template)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\canvas\”, line 33, in get_matching_configs
configs = template.match(canvas)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\gl\”, line 32, in match
return self._get_pixel_format_descriptor_matching_configs(canvas)

File “C:\Users\1523053295E\Desktop\WinPython-64bit-\psychopy\pyglet\gl\”, line 91, in _get_pixel_format_descriptor_matching_configs
pf = _gdi32.ChoosePixelFormat(canvas.hdc, byref(pfd)) #pfd

TypeError: byref() argument must be a ctypes instance, not ‘PIXELFORMATDESCRIPTOR’

  1. Relevant code

def _get_pixel_format_descriptor_matching_configs(self, canvas):
’’‘Get matching configs using standard PIXELFORMATDESCRIPTOR

   # element.PIXELFORMATDESCRIPTOR.from_buffer(Record)


   # pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR)
    pfd.nVersion = 1

    if self.double_buffer:
        pfd.dwFlags |= PFD_DOUBLEBUFFER
        pfd.dwFlags |= PFD_DOUBLEBUFFER_DONTCARE

    if self.stereo:
        pfd.dwFlags |= PFD_STEREO
        pfd.dwFlags |= PFD_STEREO_DONTCARE

    '''Not supported in pyglet API        
    if attributes.get('swap_copy', False):
        pfd.dwFlags |= PFD_SWAP_COPY
    if attributes.get('swap_exchange', False):
        pfd.dwFlags |= PFD_SWAP_EXCHANGE

    if not self.depth_size:
        pfd.dwFlags |= PFD_DEPTH_DONTCARE

    pfd.iPixelType = PFD_TYPE_RGBA
    pfd.cColorBits = self.buffer_size or 0
    pfd.cRedBits = self.red_size or 0
    pfd.cGreenBits = self.green_size or 0
    pfd.cBlueBits = self.blue_size or 0
    pfd.cAlphaBits = self.alpha_size or 0
    pfd.cAccumRedBits = self.accum_red_size or 0
    pfd.cAccumGreenBits = self.accum_green_size or 0
    pfd.cAccumBlueBits = self.accum_blue_size or 0
    pfd.cAccumAlphaBits = self.accum_alpha_size or 0
    pfd.cDepthBits = self.depth_size or 0
    pfd.cStencilBits = self.stencil_size or 0
    pfd.cAuxBuffers = self.aux_buffers or 0

return []

    #^$  byref(pfd)=cast(byref(pfd),ctypes.byref(pfd))
   # print(byref(pfd))


   # backends = POINTER(POINTER(pfd))()
  #  pixelFormat = windll.gdi32.ChoosePixelFormat(canvas.hdc, byref(pfd))
 #   pfd=ctypes.POINTER(pfd)

#$3    print(pfd)
    pf = _gdi32.ChoosePixelFormat(canvas.hdc, byref(pfd)) #pfd


From the filenames it looks like you’re using an incompatible python installation (64bit python 3.5?). We can’t support that I’m afraid. Install the Standalone app instead please