Topic: Could not initialize Vapoursynth

I'm using macOS High Sierra. Just purchased SVP.

While trying to play a video using mpv, I get this error in the event log:

VS - Could not initialize VapourSynth scripting.

mpv was complied with vapoursynth. What am I missing?

Re: Could not initialize Vapoursynth

More from the mpv log

[   0.988][i][vf] Opening video filter: [vapoursynth file=/Users/swapnil/Library/Application Support/SVP4/scripts/22ca03a3.py buffered-frames=4 concurrent-frames=15]
[   0.988][v][vapoursynth] Setting option 'file' = '/Users/swapnil/Library/Application Support/SVP4/scripts/22ca03a3.py' (flags = 0)
[   0.988][v][vapoursynth] Setting option 'buffered-frames' = '4' (flags = 0)
[   0.988][v][vapoursynth] Setting option 'concurrent-frames' = '15' (flags = 0)
[   1.011][f][vapoursynth] Could not initialize VapourSynth scripting.
[   1.011][e][vf] Creating filter 'vapoursynth' failed.

Re: Could not initialize Vapoursynth

Looks like you have some troubles with vapoursynth or its version.
You can try to reinstall mpv and install it again:
1. brew uninstall mpv
2. https://www.svp-team.com/wiki/SVP:Mac

If it don't help you then send us results of commands:
1. brew info mpv
2. brew info vapoursynth

Re: Could not initialize Vapoursynth

> What am I missing?

You probably have several Python 3 installations (one from Homebrew and another one somewhere else)

Re: Could not initialize Vapoursynth

Chainik wrote:

> What am I missing?

You probably have several Python 3 installations (one from Homebrew and another one somewhere else)

I only have one installation of Python3. Just confirmed.

Re: Could not initialize Vapoursynth

MAG79 wrote:

If it don't help you then send us results of commands:
1. brew info mpv
2. brew info vapoursynth

For "brew info mpv"

mpv: stable 0.27.2 (bottled), HEAD
Media player based on MPlayer and mplayer2
https://mpv.io
/usr/local/Cellar/mpv/0.27.2 (61 files, 36.7MB) *
  Built from source on 2018-04-18 at 23:34:05 with: --with-vapoursynth --with-bundle
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mpv.rb
==> Dependencies
Build: pkg-config ✔, python ✔
Required: libass ✔, ffmpeg ✔, lua@5.1 ✔
Recommended: jpeg ✔, little-cms2 ✔, mujs ✔, youtube-dl ✔
Optional: jack ✘, libaacs ✘, libarchive ✘, libbluray ✔, libcaca ✘, libdvdnav ✘, libdvdread ✘, p
ulseaudio ✘, rubberband ✘, uchardet ✔, vapoursynth ✔
==> Requirements
Required: macOS >= 10.8 ✔
Optional: x11 ✔
==> Options
--with-bundle
        Enable compilation of the .app bundle.
--with-jack
        Build with jack support
--with-libaacs
        Build with libaacs support
--with-libarchive
        Build with libarchive support
--with-libbluray
        Build with libbluray support
--with-libcaca
        Build with libcaca support
--with-libdvdnav
        Build with libdvdnav support
--with-libdvdread
        Build with libdvdread support
--with-pulseaudio
        Build with pulseaudio support
--with-rubberband
        Build with rubberband support
--with-uchardet
        Build with uchardet support
--with-vapoursynth
        Build with vapoursynth support
--with-x11
        Build with x11 support
--without-jpeg
        Build without jpeg support
--without-little-cms2
        Build without little-cms2 support
--without-mujs
        Build without mujs support
--without-youtube-dl
        Build without youtube-dl support
--HEAD
        Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

For "brew info vapoursynth"

vapoursynth: stable 43 (bottled), HEAD
Video processing framework with simplicity in mind
http://www.vapoursynth.com
/usr/local/Cellar/vapoursynth/43_1 (22 files, 3.1MB) *
  Poured from bottle on 2018-04-18 at 23:33:07
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/vapoursynth.rb
==> Dependencies
Build: autoconf ✔, automake ✔, libtool ✔, pkg-config ✔, nasm ✔
Required: libass ✔, python ✔, tesseract ✔, zimg ✔
==> Requirements
Required: macOS >= 10.11 ✔
==> Options
--HEAD
        Install HEAD version

Re: Could not initialize Vapoursynth

> "Could not initialize VapourSynth scripting."

It always means some mess in Python configuration - "vapoursynth.so" is missing from site-packages or built for another Python version.

The correct config:

bash-3.2$ ls -l /usr/local/opt/python
lrwxr-xr-x  1 chainik  admin  22 Apr 18 22:38 /usr/local/opt/python -> ../Cellar/python/3.6.5

bash-3.2$ otool -L /usr/local/bin/mpv
/usr/local/bin/mpv:
    ...
    /usr/local/opt/vapoursynth/lib/libvapoursynth-script.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/vapoursynth/lib/libvapoursynth.dylib (compatibility version 0.0.0, current version 0.0.0)

bash-3.2$ ls -l /usr/local/opt/vapoursynth
lrwxr-xr-x  1 chainik  admin  26 Apr 18 22:38 /usr/local/opt/vapoursynth -> ../Cellar/vapoursynth/43_1

bash-3.2$ ls -l /usr/local/lib/python3.6/site-packages/vapoursynth.so 
lrwxr-xr-x  1 chainik  admin  75 Apr 18 22:38 /usr/local/lib/python3.6/site-packages/vapoursynth.so -> ../../../Cellar/vapoursynth/43_1/lib/python3.6/site-packages/vapoursynth.so

bash-3.2$ otool -L /usr/local/opt/vapoursynth/lib/libvapoursynth-script.0.dylib
/usr/local/opt/vapoursynth/lib/libvapoursynth-script.0.dylib:
    ...
    /usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/Python (compatibility version 3.6.0, current version 3.6.0)