Skip to content
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

[Bug]: OpenCV is not working #20334

Closed
Ar57m opened this issue May 27, 2024 · 6 comments
Closed

[Bug]: OpenCV is not working #20334

Ar57m opened this issue May 27, 2024 · 6 comments
Labels
bug report Something is not working properly

Comments

@Ar57m
Copy link

Ar57m commented May 27, 2024

Problem description

recently I pkg update everything, and cv2 stopped working, somebody know how to fix it?
I forgot to copy the logs of the update but I have a screenshot,
Screenshot_20240526_214418_Termux

the error running the python script:

Traceback (most recent call last):
  File "/data/data/com.termux/files/home/another/runner.py", line 3, in <module>
    import cv2
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen failed: cannot locate symbol "_ZN4absl12lts_2023080212log_internal9kCharNullE" referenced by "/data/data/com.termux/files/usr/lib/libopencv_dnn.so"...

What steps will reproduce the bug?

pkg update and upgrade
run a python script importing cv2

What is the expected behavior?

import cv2

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=18146
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.vern.cc/termux/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
Updatable packages:
All packages up to date
termux-tools version:
1.42.1
Android version:
13
Kernel build information:
Linux localhost 5.4.210-qgki-27101688-abM526BXXS4CWL2 #1 SMP PREEMPT Wed Dec 27 18:07:41 KST 2023 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-M526B
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@Ar57m Ar57m added bug report Something is not working properly untriaged labels May 27, 2024
@Ar57m
Copy link
Author

Ar57m commented May 27, 2024

btw i got this warning installing opencv

WARNING: opencv-python is compiled with numpy 1.26.2, but numpy 1.26.4 is installed. Please report it to https://github.com/termux/termux-packages if any bug happens. 
`` 

@licy183 licy183 removed the untriaged label May 27, 2024
@licy183
Copy link
Member

licy183 commented May 27, 2024

opencv has been removed from main to x11. Please install x11-repo.

apt install x11-repo && apt update && apt install opencv

@Ar57m
Copy link
Author

Ar57m commented May 27, 2024

opencv has been removed from main to x11. Please install x11-repo.

apt install x11-repo && apt update && apt install opencv

thanks now it's working fine 🤗

@Ar57m Ar57m closed this as completed May 27, 2024
@Ar57m
Copy link
Author

Ar57m commented May 28, 2024

@licy183 btw sorry to bother you, I've been trying to create a video with pngs using imageio.v2, but ffmpeg keeps giving me this error, do you know how to fix it?

CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/ffmpeg": cannot locate symbol "EVP_MD_CTX_init" referenced by "/system/lib64/libsqlite.so"...
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/imageio_ffmpeg/_io.py", line 627, in write_frames
    p.stdin.write(bb)
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/data/com.termux/files/home/man/another_fractal_generator/runner.py", line 371, in <module>
    writer.append_data(image)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/imageio/core/format.py", line 590, in append_data
    return self._append_data(im, total_meta)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/imageio/plugins/ffmpeg.py", line 600, in _append_data
    self._write_gen.send(im)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/imageio_ffmpeg/_io.py", line 634, in write_frames
    raise IOError(msg)
OSError: [Errno 32] Broken pipe

FFMPEG COMMAND:
/data/data/com.termux/files/usr/bin/ffmpeg -y -f rawvideo -vcodec rawvideo -s 1600x1600 -pix_fmt rgb24 -r 10.00 -i - -an -vcodec libx264 -pix_fmt yuv420p -v warning /data/data/com.termux/files/home/man/another_fractal_generator/output.mp4

FFMPEG STDERR OUTPUT:

@licy183
Copy link
Member

licy183 commented May 29, 2024

Try installing libandroid-stub. apt install libandroid-stub

@Ar57m
Copy link
Author

Ar57m commented May 29, 2024

Try installing libandroid-stub. apt install libandroid-stub

thanks again 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly
Projects
None yet
Development

No branches or pull requests

2 participants