Wondering if anyone else has been having a similar issue.
One of my experiments was running fine on a Windows 10 pc, until about a week ago. I got the following error in PsychoPy:
Unexpected error loading library avbin
pyo version 0.6.6 (uses single precision)
10.3311 ERROR avbin.dll failed to load.
Try importing psychopy.visual as the first library
(before anything that uses scipy)
and make sure that avbin is installed.
This was followed by a âpythonw.exe has stopped workingâ Windows error.
I changed my code so that psychopy.visual was imported first and checked that avbin was installed. I also played around with the version of avbin.dll in PsychoPy and in System32, based on some suggestions I found online. I no longer get an error in PsychoPy, but I still get the âpythonw.exe has stopped workingâ error.
I also tried running from the command line in case it was specifically pythonw.exe that was the problem, but then I just got âpython.exe has stopped working.â
The only thing I can think of that changed from when this experiment worked to when it stopped working is that Windows installed updates. However, Iâm running several other experiments, and this is the only one that crashes. A few other bits of info:
This experiment plays and records sound. I have other experiments that play sound, but this is the only one that records (and again, the only one that crashes).
I updated to 1.84.1, but that doesnât seem to have made a difference
I tried running this on a Mac and it works. Havenât been able to run on another PC yet.
The avbin file is avbin.dll in some places and avbin64.dll in others (this may be obvious to many of youâŚ)
Has anyone else run into problems following the recent Windows update? Or any other ideas?
Hi, the avbin message can, to my knowledge, be safely ignored as long as you donât use certain movie stimuli.
PsychoPy 1.84.2 has just been released, could you try to update and see if the behavior persists? Are you using the standalone PsychoPy package? Can you try narrowing down which functions/which code specifically causes your experiment to crash?
Iâm trying the PsychoPy update - will report back. Iâm having a really hard time narrowing down the problematic code because Iâm not getting any errors from PsychoPy and it doesnât always crash at the same point, but it does seem to mostly crash in the middle of playing the first audio file in a loop of trials that contain:
Play audio file
Record audio file
Press key to go to the next file
(If problem persists, I can send actual code.)
Just wanted to point out that this message is probably unrelated to the nasty behavior youâre observing
You could possibly try to select a different audio backend. At least for playback, both PyGame and Pyo are supported. I donât know about recording, though.
Quite possible, but itâs the only message Iâm getting. :-/
Updating to 1.84.2 did not help.
In case it helps, Iâm attaching the code for my practice trial, which plays an audio file (with text onscreen), records the participantâs spoken response, and ends when the participant presses âenter.â This seems to work fine.
Iâm also attaching the code for my loop of experimental trials, which does the same thing, but also allows the participant to skip a sentence for later playback by pressing the space bar. The program is crashing at some point while the first audio file in this loop is playing, before it gets to the ârecordâ screen.
Hm thereâs quite some stuff going on there, and way too much for me to really âunderstandâ the code at a single glance. Even worse, I cannot run the code and step through it with a debugger, since itâs just snippets. Could you please try to provide some sort of minimal working example that would allow us to possibly reproduce your problem? Thanks!
I had a similar issue once I updated to 1.84 for experiments with audio which worked fine before. I reinstalled pyo and itâs fixed the problem as far as I can tell. Not sure why, but worth a try maybe?
Heya, Iâm experiencing similar problems. Iâm on Win7 and recently updated to Psychopy 1.84.2 using the standalone version.
Not sure if it is related, but I canât run my experiments anymore, since python crashes (no error message in Psychopy). I donât think Iâve changed anything and there were no windows updates.
I have 3 experiment files, but they only differ by the stimuli used. The experiment using pictures works fine, but the 2 using videos donât anymore. Iâm using moviepy as backend (the others donât work at all). Now, the weird part is that when I tell Psychopy not to use audio, then the experiments work. This is quite a problem, as the audio is very important for my experiments. Following the suggestion by markdatkinson64, I reinstalled pyo, but that didnât change anything.
I probably should also mention that the crashing is not related to the complexity of the experiment or size of the stimuli. Even when I create a test-experiment with only the movie object and ITI, python crashes and even if I specify only 1 trial, it crashes. The crash always happens at the end of the video while the last frame is still visible. In the test-experiment showing only 1 video, I do get an error message in Psychopy: âFile âC:\Program Files (x86)\PsychoPy2\lib\site-packages\matplotlib\path.pyâ, line 496, in contains_point transform)
RuntimeError: Unknown exception in point_in_pathâ (This error does not show for my actual experiments).
Iâd appreciate help on this issue and hope there is a solution. Thanks.
Running python (the âpython.exeâ file) in XP compatibility mode and giving it administrator rights (donât know if thatâs necessaryâŚ) seems to alleviate the problem for me for the time being. Since my task isnât time critical, thatâs OK for me, but I donât know if this setting affects performance in more demanding taks?
/Thomas K.
Thanks, Thomas for this suggestion. I would have never thought of that.
I just tried it and the outcome is that one movie experiment runs through completely, but after completion I get an error saying: âportaudio error in Pa_AbortStream: Unanticipated host errorâ. This error wouldnât bug me if I didnât get the same error with the other movie experiment, which now aborts about half way through. Itâs progress, but not quite there yet. Any ideas? Thanks again.
Update:
I found a solution: I suppose portaudio is related to pyo, so I changed the order in the Psychopy preferences to chose pygame over pyo. First, I received an error message saying there was no pygame module and indeed I couldnât find pygame in my Psychopy folder. So I downloaded the respective pygame .whl and put it in the Psychopy Scripts folder. From there I installed it using the command window. Now all my video-based experiments are running smoothly to the end without any error messages. Phew!
Dear @Tan!
Iâm having a similar problem (see this other thread http://discourse.psychopy.org/t/windows-error-pythonw-exe-has-stopped-working-please-help/1388) and wanted to try out your suggestion with changing the order in the Psychopy preferences to chose pygame over pyo. Also in my case (PsychoPy version 1.84.2 Standalone on Win7) pygame is not yet installed, and Iâm having trouble understanding how you installed that - to which Scripts folder (there are severalâŚ) did you copy the file? And how do you install something using the command window (where do I find the command window)? Iâm sorry, I am not very experienced with all of this yet⌠I am using the builder view, and am inexperienced with coding!
@raina
Hm, Iâve only got 1 folder called âScriptsâ, so I canât help you there, Iâm afraid.
To open the cmd window, you need to hold âshiftâ and right click simultaneously, then click âopen command window hereâ.
In the command window you type:
python -m pip install whateverthenameofthewhl.whl
On a different note, how long are the videos youâre using? My experience using pygame is that the psychopy experiment will abort due to memory skyrocketing when trying to load the audio of a video that is longer then 4.5min (âmemory errorâ). @jon, is this a bug and is there a way to fix this? The memory error occurs irrespective of the file size.
Thank you Tan! I just encountered some issues related to pyo and python crashing when loading a sound. Thanks to your solution I was able to install pygame and adjust the settings in psychopy, now everything runs smoothly
@Tan I donât know what the problem is. Yes, weâve seen issues with pyo having memory leaks and maybe itâs caused by that. The latest version of PsychoPy on win32 will have pygame included (not on the mac version because pygame isnât supporting 64bit python yet). Iâve also been adding a newer alternative to pyo called sounddevice that will hopefully fix some of the pyo memory issues (hopefully they arenât related to portaudio per se because this does use portaudio as well). So fingers crossed that will help but I donât have any clear answer for you Iâm afraid.
@jon Thanks for your response. I switched to pygame straight away, see here: Randomly âpython.exe has stopped workingâ - After Windows update?
Pygame sort of works for me, except for the issue with the length of the video. I just tried sounddevice and unfortunately, it doesnât work for me. I think portaudio might be the issue indeed.
I want to say, I really like psychopy and prefer it to eprime. Since all my research is video-based, I hope there will be a solution eventually.
FYI The phrase âit doesnât workâ is almost never useful without an explanation of what went wrong. Was there an error message? What happened? There some of the possibilities (there are many more):
you tried to use sounddevice on a machine that didnât have the necessary code (because Iâm only just releasing it now as part of 1.85)
you did something wrong while trying to use it (set the preferences incorrectly)
you did everything correct and there is a genuine bug that I need to fix
The point is that I have no idea which of these is the case because you just said âit didnât workâ with no error message or description of what happened.
@jon I thought it was implied that weâre talking about âmemory errorâ, which is the current problem. My bad. Iâm sorry, from your comment I could not derive that sounddevice is yet to come with an update. It sounded to me like it has been added and I just didnât know about it. Regarding the preferences, I tried every possible combination - to my awareness. Itâd be great if I did something wrong; should be an easy fix then. Previous problems were, when using pyo: âportaudio error in Pa_AbortStream: Unanticipated host errorâ (but experiment finished) and more importantly, as experiment aborted:
I get this error message with every video longer than 4:30, regardless of file size or format. I get this error also on different machines. When I edit the videos to a shorter duration, it works (i.e. no memory error).
Following this discussion, I switched to pygame too (which solved the problems I had with presenting a movie), so thanks! @Tan - I donât know if this is relevant, but I also had a memory issue when using MovieStim3. However with MovieStim2 (combined with pygame), I can present movies that are 15 min long. If youâre using MovieStim3, it may be worthwhile trying MovieStim2