Skip to content

problem with instantstyle #905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TheMich01 opened this issue Feb 7, 2025 · 1 comment
Open

problem with instantstyle #905

TheMich01 opened this issue Feb 7, 2025 · 1 comment

Comments

@TheMich01
Copy link

<<PINOKIO_SHELL>>eval "$(conda shell.bash hook)" ; conda deactivate ; conda deactivate ; conda deactivate ; conda activate base ; source /home/slate/pinokio/api/instantstyle.git/app/env/bin/activate /home/slate/pinokio/api/instantstyle.git/app/env ; python app.py
Traceback (most recent call last):
File "/home/slate/pinokio/api/instantstyle.git/app/app.py", line 7, in
import cv2
File "/home/slate/pinokio/api/instantstyle.git/app/env/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/slate/pinokio/api/instantstyle.git/app/env/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/home/slate/pinokio/bin/miniconda/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libpng16-ef62451c.so.16.44.0: cannot open shared object file: No such file or directory

(env) (base) <<PINOKIO_SHELL>>

the library are missing, i try to instal them via pip but with no resoult.
Any suggestions?

@cat2oon
Copy link

cat2oon commented Mar 26, 2025

I tried setting LD_LIBRARY_PATH and so on, but it didn't work.

So I solved it by registering SO libraries directly in the code to handle it, which is not a clean way but annoying.
The order of the SO libraries below is important.
Some of them have dependencies on each other and need to be loaded first.

so_dir = "your_path/pinokio/api/fluxgym.git/env/lib64/python3.10/site-packages/opencv_python_headless.libs"             
sys.path.append(so_dir)                                                                                                 
                                                                                                                        
xs = ["libavutil-734d06dd.so.57.28.100",  "libswresample-3e7db482.so.4.7.100", "libvpx-9f572e11.so.9.1.0", "libcrypto-8c1ab3ad.so.1.1","libssl-28bef1ac.so.1.1","libquadmath-96973f99.so.0.0.0", "libavcodec-76c43bf0.so.59.37.100", "libavformat-d296e685.so.59.27.100", "libgfortran-91cc3cb1.so.3.0.0", "libopenblas-r0-f650aae0.3.3.so", "libpng16-ef62451c.so.16.44.0", "libswscale-95ddd674.so.6.7.100" ]                                                                                                                     
                                                                                                                        
for item in xs:                                                                                                         
    path = so_dir + "/{0}".format(item)                                                                                 
    ctypes.CDLL(path, mode=ctypes.RTLD_GLOBAL)  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants