1

I'm trying to deploy a python bot that use opencv on discloud but when I start the app it show the error:

#Traceback (most recent call last):
E  File "/home/user_1028648117500924025/main.py", line 1, in <module>
    import cv2
X  File "/usr/local/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
Y  File "/usr/local/lib/python3.10/site-packages/cv2/__init__.py", line 153, in bootstrap
3    native_module = importlib.import_module("cv2")
U  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
@    return _bootstrap._gcd_import(name[level:], package, level)
SImportError: libGL.so.1: cannot open shared object file: No such file or directory
Nick ODell
  • 15,465
  • 3
  • 32
  • 66
Alex
  • 51
  • 4

1 Answers1

-1

Since your are trying to install this on a cloud provider's instance (discloud in this case), it might be missing some dependencies required by cv2

Have a look at this ImportError: libGL.so.1: cannot open shared object file: No such file or directory

From the top voted answer:

Add the following lines to your Dockerfile:

RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y
Burak
  • 2,251
  • 1
  • 16
  • 33