Can't deploy to streamlit

hi, I have a problem while deploying my application,
first problem “ImportError libGL.so.1 cannot open shared object file No such file or directory” I fixed it, but new problem appears
"Traceback (most recent last call):

File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 552, in _run_script

exec(code, module.__dict__)

File “/mount/src/kursilive-gita/app.py”, line 6, in

import cv2

File “/home/adminuser/venv/lib/python3.9/site-packages/cv2/init.py”, line 181, in

bootstrap()

File “/home/adminuser/venv/lib/python3.9/site-packages/cv2/init.py”, line 175, in bootstrap

if __load_extra_py_code_for_module("cv2", submodule, DEBUG):

File “/home/adminuser/venv/lib/python3.9/site-packages/cv2/init.py”, line 28, in __load_extra_py_code_for_module

py_module = importlib.import_module(module_name)

File “/usr/local/lib/python3.9/importlib/init.py”, line 127, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File “/home/adminuser/venv/lib/python3.9/site-packages/cv2/typing/init.py”, line 69, in

NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]

TypeError: ‘numpy._DTypeMeta’ object is not subscriptable"
how to fix it?

Hi, did you include OpenCV in your requirements.txt file, if not, you can try to include that, and can you share your github project link too, so that we can take a look at the numpy array error

Hey @Melo04,

Can you please share a link to your GitHub repo and the deployed app so we can help you troubleshoot this issue?

hi, i have included opencv-contrib-python==4.8.0.76
opencv-python==4.8.0.76
at requirements.txt

github: GitHub - arfianaja/kursilive-Gita: aplikasi mendeteksi kursi kosong dan terisi, menggunakan algoritma yolov5

thank you

github : GitHub - arfianaja/kursilive-Gita: aplikasi mendeteksi kursi kosong dan terisi, menggunakan algoritma yolov5

hi melo04, I have fixed the first problem, the application is running, but when I access the camera it can’t, even though in the application that I ran before deploying the camera can be used

[ERROR:12@377.260] global obsensor_uvc_stream_channel.cpp:156 getStreamChannelGroup Camera index out of range

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.