uoz 作業日記


"avbin.dll failed to load" with PsychoPy


Replace "from pyglet.media import avbin" to "from pyglet.media.sources import avbin" in psychopy/visual/window.py.


psychopy/visual/window.pyの from pyglet.media import avbin を from pyglet.media.sources import avbin に書き換えればとりあえず動きます。

My PsychoPy and the environment

  • Windows 10 Fall Creators Update
  • PsychoPy 1.85.6 Standalone

I downloaded StandalonePsychoPy-1.85.6-win32.exe from https://github.com/psychopy/psychopy/releases and installed it.

Error: "Avbin.dll fail to load"

I created a simple stimuli following this japanese tutorial.

2. 刺激の位置や提示時間の指定方法を覚えよう — PsychoPy Builderで作る心理学実験 2.1 ドキュメント


The stimuli was shown, but after the stimuli window closed, an error was shown.


I did not use any image or video stimulus.

This problem has been discussed in official github issues, but will not be fixed. Windows fails to load avbin.dll · Issue #693 · psychopy/psychopy · GitHub


I compiled my .pysexp file to .py, and debug step by step.

I found that the error was occurred when pyglet.media.avbin module isimported in line 35 of /Lib/site-packages/psychopy/visual/window.py

from pyglet.media import avbin I searched the module pyglet.media.avbin, and it was not found. I found "pyglet.media.sources.avbin" instead.

I assume that "pyglet.media.avbin" is depend on old package structure. In Standalone PychoPy 1.85.6, Installed pyglet was version 1.3, and avbin.py is located in "pyglet/media/sources/", not in "pyglet/media/"

avbin.py of pyglet 1.3 https://bitbucket.org/pyglet/pyglet/src/ab98c6b7478422acbf9b893f01c0e7778bc1ad9d/pyglet/media/sources/avbin.py?at=pyglet-1.3-maintenance&fileviewer=file-view-default

However, avbin.py is located in "pyglet/media/" in pyglet 1.1 and pyglet 1.2

avbin.py of pyglet 1.2 https://bitbucket.org/pyglet/pyglet/src/f41e4749e69adac0af5bf03b67238d0ca94bbf4a/pyglet/media/avbin.py?at=pyglet-1.2-maintenance&fileviewer=file-view-default


I replace "from pyglet.media import avbin" to "from pyglet.media.sources import avbin" in psychopy/visual/window.py. f:id:uoz:20180223144227p:plain

I do not know if this fix is ​​appropriate or not, but it works well.



My first pull request for OSS was merged!!

Merge pull request #1744 from uozias/master · psychopy/psychopy@5bdf5ba · GitHub