Endilll/vapoursynth-preview

Cannot start vspreview

Opened this issue · 6 comments

I cannot start VS Preview (Win 7 64 bits). README.md says that only Python 3.8 is required but the warning from the log tells something different and I don’t know if this is the cause of the problem:

2021-10-14 11:16:54.407: WARNING: VSPreview is not tested on Python versions prior to 3.9, but you have 3.8.0 final. Use at your own risk.
2021-10-14 11:16:54.422: DEBUG: Reading QSS file in: :qdarkstyle\dark\style.qss
2021-10-14 11:16:54.422: INFO: QSS file sucessfuly loaded.
2021-10-14 11:16:54.423: DEBUG: Checking patches for being applied.
2021-10-14 11:16:54.423: INFO: Found version patches to be applied.
2021-10-14 11:16:54.423: INFO: Found application patches to be applied.
Traceback (most recent call last):
  File "C:\Program Files\Vapoursynth Preview\run.py", line 4, in <module>
    main()
  File "C:\Program Files\Vapoursynth Preview\vspreview\main.py", line 843, in main
    main_window = MainWindow()
  File "C:\Program Files\Vapoursynth Preview\vspreview\core\bases.py", line 24, in __call__
    cls.instance = super().__call__(*args, **kwargs)
  File "C:\Program Files\Vapoursynth Preview\vspreview\core\better_abc.py", line 25, in __call__
    instance = NativeABCMeta.__call__(cls, *args, **kwargs)
  File "C:\Program Files\Vapoursynth Preview\vspreview\main.py", line 413, in __init__
    self.toolbars = Toolbars(self)
  File "C:\Program Files\Vapoursynth Preview\vspreview\core\bases.py", line 24, in __call__
    cls.instance = super().__call__(*args, **kwargs)
  File "C:\Program Files\Vapoursynth Preview\vspreview\core\better_abc.py", line 25, in __call__
    instance = NativeABCMeta.__call__(cls, *args, **kwargs)
  File "C:\Program Files\Vapoursynth Preview\vspreview\main.py", line 280, in __init__
    self.pipette   =   PipetteToolbar(main_window)
  File "C:\Program Files\Vapoursynth Preview\vspreview\core\better_abc.py", line 25, in __call__
    instance = NativeABCMeta.__call__(cls, *args, **kwargs)
  File "C:\Program Files\Vapoursynth Preview\vspreview\toolbars\pipette.py", line 46, in __init__
    self.outputs = WeakKeyDictionary[Output, vs.VideoNode]()
TypeError: 'ABCMeta' object is not subscriptable

Thank you for pointing out to stale readme. It says the same as warnings now.
Can you upgrade to 3.9 and try again?

3.8 is the latest win7 supported version. Maybe its possible to compile 3.9 for win7, but I never tried.

Indeed sorry I haven’t any Win 10 rig here so I cannot install Python 3.9 to test.

From this thread , it seems that you can’t add type annotations to abstract base classes in collections.abc.
WeakKeyDictionary inherits from collections.abc.MutableMapping so that’s why it doesn’t work in Python 3.8.

self.outputs = WeakKeyDictionary[Output, vs.VideoNode]()

Quick and dirty fix is just removing the annotations of it like this self.outputs = WeakKeyDictionary()

@EleonoreMizo Minor, but you should update to the latest update of 3.8. Friends have a lot of weird issues with 3.8.0 and none with 3.8.10.
3.8.11 and 3.8.12 are just security updates and you can probably skip them. 3.8.10 should be good enough.

Thanks for the tip. Unfortunately this leads to other errors, so I guess it’s probably a dead end without Python 3.9.

It worked fine for me using 3.8.10. It was on Windows Server 2019 though.