Jaded-Encoding-Thaumaturgy / vs-preview

Previewer for VapourSynth scripts.
Apache License 2.0
57 stars 16 forks source link

Bone in the pipe? pip3 weird behavior on ubuntu 22.04 #157

Closed sosie-js closed 1 week ago

sosie-js commented 1 week ago

On the https://pypi.org/project/vspreview/ website it is indicated 0.9.0 but when I do:

pip3 install -U vspreview 0.9.0
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: vspreview in /home/pi/.local/lib/python3.10/site-packages (0.7.1)

So I deleted cache

pi@uefi-x86:~/.local/lib/python3.10/site-packages$ rm -r vspreview
pi@uefi-x86:~/.local/lib/python3.10/site-packages$ rm -r vspreview-0.7.1.dist-info

and reinstalled vspreview. pip3 install vspreview gives:

Defaulting to user installation because normal site-packages is not writeable
Collecting vspreview
  Downloading vspreview-0.7.1-py3-none-any.whl.metadata (2.9 kB)
Requirement already satisfied: VapourSynth>=63 in /home/pi/.local/lib/python3.10/site-packages (from vspreview) (66)
...
y>=2.2.0->rich>=12.6.0->vstools>=2.3.0->vspreview) (0.1.2)
Downloading vspreview-0.7.1-py3-none-any.whl (123 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.6/123.6 kB 2.2 MB/s eta 0:00:00
WARNING: Error parsing dependencies of send2trash: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
    sys-platform (=="darwin") ; extra == 'objc'
                 ~^
WARNING: Error parsing dependencies of devscripts: Invalid version: '2.22.1ubuntu1'
Installing collected packages: vspreview
Successfully installed vspreview-0.7.1

It seems to be locked to 0.7.1!

All went good but when I trigger vspreview it crashes

  File "/home/pi/.local/lib/python3.10/site-packages/vspreview/main/window.py", line 94, in STATUS_FRAME_PROP
    return 'Type: %s' % (prop['_PictType'].decode('utf-8') if '_PictType' in prop else '?')
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?

unless I patch it with

window=`python3 -c "import vspreview as _; print(str.replace(_.__file__,'__init__','main/window'))"`;sed 's/decode/encode/g' $window > $window.tmp ; cp $window.tmp  $window; rm $window.tmp

So I tried with github:

pip install -U git+https://github.com/Jaded-Encoding-Thaumaturgy/vs-preview.git

it fails to detect vapoursynth I installed with the same pip3 install. EDIT: I did install vapoursynth from sources instead - @selur did a great work for linux to have vs plugins

wget https://codeload.github.com/vapoursynth/vapoursynth/tar.gz/refs/tags/R68
tar xvzf R68
cd vapoursynth-R68
./configure --prefix=/home/$USER/.local/
make
make install

all went good all is installed locally for the normal current user

make[1] : on entre dans le répertoire « /media/pi/save/Ubuntu.AppImage/vapoursynth-R68 »
 /usr/bin/mkdir -p '/home/pi/.local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libvapoursynth.la libvapoursynth-script.la '/home/pi/.local/lib'
libtool: install: /usr/bin/install -c .libs/libvapoursynth.so /home/pi/.local/lib/libvapoursynth.so
libtool: install: /usr/bin/install -c .libs/libvapoursynth.lai /home/pi/.local/lib/libvapoursynth.la
libtool: install: /usr/bin/install -c .libs/libvapoursynth-script.so.0.0.0 /home/pi/.local/lib/libvapoursynth-script.so.0.0.0
libtool: install: (cd /home/pi/.local/lib && { ln -s -f libvapoursynth-script.so.0.0.0 libvapoursynth-script.so.0 || { rm -f libvapoursynth-script.so.0 && ln -s libvapoursynth-script.so.0.0.0 libvapoursynth-script.so.0; }; })
libtool: install: (cd /home/pi/.local/lib && { ln -s -f libvapoursynth-script.so.0.0.0 libvapoursynth-script.so || { rm -f libvapoursynth-script.so && ln -s libvapoursynth-script.so.0.0.0 libvapoursynth-script.so; }; })
libtool: install: /usr/bin/install -c .libs/libvapoursynth-script.lai /home/pi/.local/lib/libvapoursynth-script.la
libtool: install: /usr/bin/install -c .libs/libvapoursynth.a /home/pi/.local/lib/libvapoursynth.a
libtool: install: chmod 644 /home/pi/.local/lib/libvapoursynth.a
libtool: install: ranlib /home/pi/.local/lib/libvapoursynth.a
libtool: install: /usr/bin/install -c .libs/libvapoursynth-script.a /home/pi/.local/lib/libvapoursynth-script.a
libtool: install: chmod 644 /home/pi/.local/lib/libvapoursynth-script.a
libtool: install: ranlib /home/pi/.local/lib/libvapoursynth-script.a
libtool: finish: PATH="/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/pi/.local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /home/pi/.local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/home/pi/.local/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c vspipe '/home/pi/.local/bin'
libtool: install: /usr/bin/install -c .libs/vspipe /home/pi/.local/bin/vspipe
 /usr/bin/mkdir -p '/home/pi/.local/lib/python3.10/site-packages'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   vapoursynth.la '/home/pi/.local/lib/python3.10/site-packages'
libtool: warning: relinking 'vapoursynth.la'
libtool: install: (cd /media/pi/save/Ubuntu.AppImage/vapoursynth-R68; /bin/bash "/media/pi/save/Ubuntu.AppImage/vapoursynth-R68/libtool"  --silent --tag CC --tag disable-static --mode=relink gcc -std=c99 -O3 -fvisibility=hidden -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-ignored-attributes -I./include -mfpmath=sse -msse2 -fvisibility=default -Wno-implicit-fallthrough -avoid-version -module -o vapoursynth.la -rpath /home/pi/.local/lib/python3.10/site-packages src/cython/vapoursynth_la-vapoursynth.lo libvapoursynth.la )
libtool: install: /usr/bin/install -c .libs/vapoursynth.soT /home/pi/.local/lib/python3.10/site-packages/vapoursynth.so
libtool: install: /usr/bin/install -c .libs/vapoursynth.lai /home/pi/.local/lib/python3.10/site-packages/vapoursynth.la
libtool: finish: PATH="/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin" ldconfig -n /home/pi/.local/lib/python3.10/site-packages
----------------------------------------------------------------------
Libraries have been installed in:
   /home/pi/.local/lib/python3.10/site-packages

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /usr/bin/mkdir -p '/home/pi/.local/lib/pkgconfig'
 /usr/bin/install -c -m 644 pc/vapoursynth.pc pc/vapoursynth-script.pc '/home/pi/.local/lib/pkgconfig'
 /usr/bin/mkdir -p '/home/pi/.local/include/vapoursynth'
 /usr/bin/install -c -m 644 include/VapourSynth.h include/VapourSynth4.h include/VSConstants4.h include/VSHelper.h include/VSHelper4.h include/VSScript.h include/VSScript4.h '/home/pi/.local/include/vapoursynth'
make[1] : on quitte le répertoire « /media/pi/save/Ubuntu.AppImage/vapoursynth-R68 »

At this point we have a running 68

pi@uefi-x86:/$ vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2023 Fredrik Mellbin
Core R68
API R4.1
API R3.6
Options: -

Unfortunately not dectected by pip3 install vspreview

Requirement already satisfied: QDarkStyle>=3.1 in /home/pi/.local/lib/python3.10/site-packages (from vspreview==0.9.0) (3.2.3)
ERROR: Could not find a version that satisfies the requirement VapourSynth>=68 (from vspreview) (from versions: 39, 40, 41, 42, 43, 44, 45, 46, 47, 47.1, 47.2, 48, 49, 50, 51, 56, 57, 58, 59, 60, 61, 62, 64, 65, 66)
ERROR: No matching distribution found for VapourSynth>=68

Where is the bone in the pip?

sosie-js commented 1 week ago

By the way, it works nicely with scite =) just put vapoursynth.properties in /etc/scite

# Define SciTE settings for Vapoursynth Python files.

file.patterns.vpy=*.vpy
file.patterns.scons=SConstruct;SConscript

*source.patterns.vapoursynth=$(file.patterns.vpy);

shbang.vapoursynth=vpy

filter.vapoursynh=Python (vpy pyw)|$(file.patterns.vpy)|

*filter.vapoursynth=$(filter.vapoursynth)

lexer.$(file.patterns.vpy)=python
lexer.$(file.patterns.scons)=python

*language.vapoursynth=Pytho&n|vpy||

keywordclass.vapoursynth=False None True and as assert break class continue \
def del elif else except finally for from global if import in is lambda \
nonlocal not or pass raise return try while with yield

# Extra keywords for cython
keywordclass.cython=cdef cimport cpdef

keywords.$(file.patterns.py)=$(keywordclass.vapoursynth) $(keywordclass.cython)
keywords.$(file.patterns.scons)=$(keywordclass.vapoursynth)

# If you uncomment the 3 lines below,
# and put some words after "keywordclass2.python=",
# those words will be styled by style.python.14

#keywordclass2.python=
#keywords2.$(file.patterns.py)=$(keywordclass2.python)
#keywords2.$(file.patterns.scons)=$(keywordclass2.python)

# Use 2 sets of substyles to highlight standard library modules and
# imports from the future.
# Additional identifier sets can be added by incrementing the  next
# line's value and adding extra definitions similar to below.
substyles.vapoursynth.11=2

substylewords.11.1.$(file.patterns.py)=\
__main__ _dummy_thread _thread abc aifc argparse \
array ast asynchat asyncio asyncore atexit audioop \
base64 bdb binascii binhex bisect builtins bz2 \
calendar cgi cgitb chunk cmath cmd code codecs \
codeop collections colorsys compileall concurrent \
configparser contextlib copy copyreg crypt csv \
ctypes curses datetime dbm decimal difflib dis \
distutils dummy_threading email ensurepip enum \
errno faulthandler fcntl filecmp fileinput fnmatch \
formatter fpectl fractions ftplib functools gc getopt \
getpass gettext glob grp gzip hashlib heapq hmac \
html http http imaplib imghdr importlib inspect io \
ipaddress itertools json keyword linecache locale \
logging lzma macpath mailbox mailcap marshal math \
mimetypes mmap modulefinder msilib msvcrt \
multiprocessing netrc nis nntplib numbers operator \
os os ossaudiodev parser pathlib pdb pickle \
pickletools pipes pkgutil platform plistlib poplib posix \
pprint pty pwd py_compile pyclbr queue quopri \
random re readline reprlib resource rlcompleter runpy \
sched select selectors shelve shlex shutil signal site \
smtpd smtplib sndhdr socket socketserver spwd \
sqlite3 ssl stat statistics string stringprep struct \
subprocess sunau symbol symtable sys sysconfig \
syslog tabnanny tarfile telnetlib tempfile termios \
textwrap threading time timeit tkinter token \
tokenize trace traceback tracemalloc tty turtle \
types unicodedata unittest urllib uu uuid venv warnings \
wave weakref webbrowser winreg winsound wsgiref \
xdrlib xml xmlrpc zipfile zipimport zlib
style.python.11.1=fore:#DD9900

substylewords.11.2.$(file.patterns.vpy)=__future__ \
with_statement unicode_literals print_function
style.vapoursynth.11.2=fore:#EE00AA,italics

#~ statement.indent.$(file.patterns.py)=10 :
statement.indent.$(file.patterns.vpy)=5 class def elif else except finally \
for if try while with

statement.lookback.$(file.patterns.vpy)=0
block.start.$(file.patterns.vpy)=
block.end.$(file.patterns.vpy)=

view.indentation.examine.*.vpy=2

tab.timmy.whinge.level=1

#fold.quotes.python=1

comment.block.vapoursynth=#~

indent.vapoursynth.colon=1

# Python styles
# White space
style.vapoursynth.0=fore:#808080
# Comment
style.vapoursynth.1=fore:#007F00,$(font.comment)
# Number
style.vapoursynth.2=fore:#007F7F
# String
style.vapoursynth.3=fore:#7F007F,$(font.monospace)
# Single quoted string
style.vapoursynth.4=fore:#7F007F,$(font.monospace)
# Keyword
style.vapoursynth.5=fore:#00007F,bold
# Triple quotes
style.vapoursynth.6=fore:#7F0000
# Triple double quotes
style.vapoursynth.7=fore:#7F0000
# Class name definition
style.vapoursynth.8=fore:#0000FF,bold
# Function or method name definition
style.vapoursynth.9=fore:#007F7F,bold
# Operators
style.vapousynth.10=bold
# Identifiers
style.vapoursynth.11=
# Comment-blocks
style.vapoursynth.12=fore:#7F7F7F
# End of line where string is not closed
style.vapoursynth.13=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Highlighted identifiers
style.vapoursynth.14=fore:#407090
# Decorators
style.vapoursynth.15=fore:#805000
# F-String
style.vapoursynth.16=fore:#7F007F,$(font.monospace)
# Single quoted f-string
style.vapoursynth.17=fore:#7F007F,$(font.monospace)
# Triple quoted f-string
style.vapoursynth.18=fore:#7F0000
# Triple double quoted f-string
style.vapoursynth.19=fore:#7F0000
# Matched Operators
style.vapoursynth.34=fore:#0000FF,bold
style.vapoursynth.35=fore:#FF0000,bold
# Braces are only matched in operator style
braces.vapoursynth.style=10

if PLAT_WIN
    vapoursynth.command=vspreview
if PLAT_GTK
    vapoursynth.command=vspreview
if PLAT_MAC
    vapoursynth.command=vspreview

if PLAT_WIN
    command.go.*.vpy=$(vapoursynth.command) "$(FileNameExt)"
    command.go.subsystem.*.vpy=1
    command.build.SConscript=scons.bat --up .
    command.build.SConstruct=scons.bat .

if PLAT_GTK
    command.go.*.vpy=$(vapoursynth.command) "$(FileNameExt)"
    command.build.SConscript=scons --up .
    command.build.SConstruct=scons .

if PLAT_MAC
    command.go.*.vpy=$(vapoursynth.command) "$(FileNameExt)"
    command.build.SConscript=scons --up .
    command.build.SConstruct=scons .

command.name.1.$(file.patterns.vpy)=Syntax Check
command.1.$(file.patterns.vpy)=$(python.command) -c "import py_compile; py_compile.compile(r'$(FilePath)')"
Vodes commented 1 week ago

I would assume its because 0.7.1 is the last version to support python 3.10

sosie-js commented 1 week ago

I would assume its because 0.7.1 is the last version to support python 3.10

There is no such restriction in the requirement.txt of vs-preview, the bad duck is the R68 that is not available though pip3. There is no source, just whl provided for windows which is very limited.

vs-preview$ cat requirements.txt VapourSynth>=68 vstools>=3.2.0 vsengine>=0.2.0 PyQt6>=6.6.1 PyQt6-sip>=13.4.0 QDarkStyle>=3.1 PyYAML>=6.0 matplotlib>=3.7.1 requests>=2.31.0 requests-toolbelt>=1.0.0 numpy>=1.24.3

Vodes commented 1 week ago

I'm not sure what the issue with the vapoursynth package is but python version doesn't go into requirements.txt anyhow. See https://github.com/Jaded-Encoding-Thaumaturgy/vs-preview/blob/master/setup.py#L30

sosie-js commented 1 week ago

I'm not sure what the issue with the vapoursynth package is but python version doesn't go into requirements.txt anyhow. See https://github.com/Jaded-Encoding-Thaumaturgy/vs-preview/blob/master/setup.py#L30

ok, do we really need such an python and vs upgrades?

Setsugennoao commented 1 week ago

Why don't you just install with --ignore-requires-python and fix the 3.11/12 stuff locally, should be a couple of things

sosie-js commented 1 week ago

@Setsugennoao, this is what I am macgyving now but seems to lack files ^^'. Failsafe is to lower version in the requirement of vstools to 2.3.0 that removes the constraints on python solving the bad detection of local installed vapoursynth . Thanks alot for your help =) Bkiss2U