Log in

View Full Version : vsutils no longer detected by VapourSynth after upgrading from R45 to R58


SilSinn9801
16th August 2022, 20:45
Hello,

I had recently upgraded my version of VapourSynth (AMD64) from R45 to R58 (plus installed Python 3.10 as required by R58), & even though I copied all VS-related Python scripts (vsutils.py, havsfunc.py, etc.) from their previous Python location (no longer remember what Py version did I have) to the new one (C:\Program Files\Python310\Lib\site-packages\vapoursynth), VS no longer detects them when I try to preview a VPY script in VapourSynth Editor r19:
Failed to evaluate the script:
Python exception: No module named 'vsutils'

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2886, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2887, in vapoursynth._vpy_evaluate
File "D:\fakepath\TH09_07.VPY", line 2, in
import vsutils as vsu
ModuleNotFoundError: No module named 'vsutils'
I attest that vsutils previously worked fine for me under R45 as per these two previous threads:
http://forum.doom9.org/showthread.php?t=176288
http://forum.doom9.org/showthread.php?t=176375

Did R58 change something about how & where to load Py scripts? Or is this a specific Py3.10 issue?

EDIT: this is how I try to import vsutils & other Py scripts into my script (the same methodology that worked for me since those two archived threads above well into August 2021, the last time I recall using R45):
from vapoursynth import core
import vsutils as vsu
import havsfunc as haf
import functools
import sys
import math
vsufuncs = vsu.vsutils()

Julek
16th August 2022, 21:06
The python files should be in C:\Program Files\Python310\Lib\site-packages
Not in C:\Program Files\Python310\Lib\site-packages\vapoursynth

I also recommend to get updated github versions to avoid error with VS new API4

And for fade effects, I recommend this script:
https://github.com/OrangeChannel/vs-transitions
Docs: https://vapoursynth-transitions.readthedocs.io/en/latest/

SilSinn9801
16th August 2022, 21:27
I also recommend to get updated github versions to avoid error with VS new API4

Huh, vsutils (plural) as in https://github.com/jeremypoulter/vsutils has not been updated since 2016, but now there is mention of a vsutil (singular) as in https://github.com/Irrational-Encoding-Wizardry/vsutil which was updated a few days ago (learned this because the most recent version of HolyWu’s havsfunc just asked me for it). Is singular vsutil a replacement for plural vsutils?

Julek
16th August 2022, 21:35
Is singular vsutil a replacement for plural vsutils?

No, they are completely different projects.

SilSinn9801
16th August 2022, 21:53
Now after moving vsutils & other scripts to the new location & refreshing all scripts that had updates, now I get this error:
Failed to evaluate the script:
Python exception: module 'vapoursynth' has no attribute 'get_core'

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2890, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2891, in vapoursynth._vpy_evaluate
File "D:\fakepath\TH09_07.VPY", line 7, in
vsufuncs = vsu.vsutils()
File "C:\Program Files\Python310\lib\site-packages\vsutils.py", line 8, in __init__
self.core = vs.get_core()
AttributeError: module 'vapoursynth' has no attribute 'get_core'
How do I remedy this thing now? (or what should I modify in vsutils.py to make it work now that its creator no longer seems to maintain it since 2016?)

EDIT: my VapourSynth install is now R59 after installing your jvsfunc script via PIP.

Julek
16th August 2022, 23:13
File "C:\Program Files\Python310\lib\site-packages\vsutils.py", line 8, in __init__
self.core = vs.get_core()
AttributeError: module 'vapoursynth' has no attribute 'get_core'

Edit vs.get_core() to vs.core