| Reference | Downloads | Github

Visual C++ Runtime error and Python/pythonw.exe crash

Before yesterday, PsychoPy v3.1.5 was working and running experiments fine and as expected (on a Windows 10 PC), but since yesterday, when launching PsychoPy and going to the Builder or accessing Preferences, the attached error occurs. Nothing had been updated or installed between it last being known to work and this first occurring. However, it is a university IT-managed machine, so who knows?


After OK is clicked, Python crashes:

We have tried updating PsychoPy to 3.2.4, both x86 and x64 versions, including uninstalling/rebooting in between, as well as manually updating the Visual C++ redistributable and Python (3.6.6 and 3.8).

If anyone has any ideas how to fix this, please let me know.

Running the troubleshooting command results in this:

C:\Windows\system32>"C:\Program Files\PsychoPy3\python.exe" -m
A s s e r t i o n   f a i l e d !

 P r o g r a m :   C : \ P r o g r a m   F i l e s \ P s y c h o P y 3 \ p y t h o n . e x e
 F i l e :   s r c / h o s t a p i / w d m k s / p a _ w i n _ w d m k s . c ,   L i n e   1 0 6 1

 E x p r e s s i o n :   F A L S E

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Any ideas?

a google search for the critical line:

reveals this:
which suggests a problem with audio libraries (so my guess is that your IT people have done some sort of update to an audio lib that added an incompatible version).

Try changing the audio lib that PsychoPy is using by going to your userprefs file in %appdata%\psychopy3 and set it to something like this

    audioLib = pyo, sounddevice, pygame

Or you could even put pygame first if you’re sure that sound timing doen’t matter to anyone using this machine!

Thank you so much for looking into this and providing this info, Jon. Much appreciated.

I had already taken the nuclear option and re-imaged the machine (as this is what IT did to solve the issue previously), but have noted this fix/workaround for if/when it happens again.

Sadly, the issue has returned (perhaps not surprisingly after a Windows update), but the suggested sound device userPrefs fix doesn’t work. :frowning:

However, this time it’s just Python that crashes and no mention of C++ runtime errors, so possibly a different issue? Deary me.

Thanks in advance.