OSError: [WinError 193] %1 is not a valid Win32 application

OS: Win 10 Home v1903
PsychoPy version: v2020.2.x , 64-bit
Standard Standalone? (y/n): y

I’ve not been able to get anything at all to run in v2020.2.2 or v2020.2.0, not even the PsychoPy Stroop demo, or even the simplest possible program containing just a text component. (v2020.1.3 is working fine.)

I get the following error message:

Welcome to PsychoPy3!
v2020.2.2
17.3312 INFO Loaded monitor calibration from [‘2020_03_29 11:24’]
Generating PsychoPy script…

Running: D:\Users…\PsychoPy\demos\stroop\stroop_lastrun.py ##
23.0823 INFO Loaded monitor calibration from [‘2020_03_29 11:24’]
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
1.2398 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).
Traceback (most recent call last):
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\win32.py”, line 25, in GL
ctypes.windll, ‘opengl32’, mode = ctypes.RTLD_GLOBAL
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\ctypesloader.py”, line 45, in loadLibrary
return dllType( name, mode )
File “C:\Program Files\PsychoPy3\lib\ctypes_init_.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Users…\PsychoPy\demos\stroop\stroop_lastrun.py”, line 18, in
from psychopy import sound, gui, visual, core, data, event, logging, clock
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual_init_.py”, line 30, in
from .textbox2.textbox2 import TextBox2
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\textbox2_init_.py”, line 4, in
from .textbox2 import TextBox2, allFonts
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\textbox2\textbox2.py”, line 20, in
import OpenGL.GL as gl
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\GL_init_.py”, line 3, in
from OpenGL import error as _error
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\error.py”, line 12, in
from OpenGL import platform, configflags
File "C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform_init
.py", line 35, in
load()
File "C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform_init
.py", line 32, in _load
plugin.install(globals())
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\baseplatform.py”, line 92, in install
namespace[ name ] = getattr(self,name,None)
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\baseplatform.py”, line 14, in get
value = self.fget( obj )
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\win32.py”, line 103, in GetCurrentContext
wglGetCurrentContext = self.GL.wglGetCurrentContext
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\baseplatform.py”, line 14, in get
value = self.fget( obj )
File “C:\Program Files\PsychoPy3\lib\site-packages\OpenGL\platform\win32.py”, line 28, in GL
raise ImportError(“Unable to load OpenGL library”, *err.args)
ImportError: (‘Unable to load OpenGL library’, 8, ‘%1 is not a valid Win32 application’, None, 193, None, ‘C:\Windows\SysWOW64\opengl32.dll’, ‘C:\Windows\SysWOW64\opengl32.dll’)
Experiment ended. #####

The error message seems to be pointing to an incompatibility between the 64-bit version of PsychoPy that I have installed and the 32-bit version of OpenGL that is included in the PsychoPy installation.

No idea why I’m getting this error, as nobody else seems to have mentioned it on this forum!

I have a similar issue but the error is:

Welcome to PsychoPy3!
v2020.1.3
## Running: C:\Users\User\Desktop\Examiner3_6\scripts\examiner\examiner_adult_english.py ##
Traceback (most recent call last):
  File "C:\Users\Dapeng\User\Examiner3_6\scripts\examiner\examiner_adult_english.py", line 31, in <module>
    avbin_lib=ctypes.cdll.LoadLibrary('avbin')
  File "C:\Program Files\PsychoPy3\lib\ctypes\__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "C:\Program Files\PsychoPy3\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
##### Experiment ended. #####

Not sure what to do…