1

in aws-eb I am deployed an application -django- and there was no error on that process. Health is green and OK but page is giving Internal Server Error. so I checked the logs and saw the below error.

... web: from .cv2 import  
... web: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

while installing requirements.txt on deployment process opencv must be installed. because it includes opencv-python==4.5.5.64 so I not quite sure what is the above error pointing at.

and helpers.py this is how I am import it.

import requests
import cv2

1 Answer 1

2

libGL.so is installed with the package libgl1, pip3 install opencv-python is not sufficient here.

Connect the aws via ssh and run;

apt-get update && apt-get install libgl1 

Or even better, consider using docker containers for the project and add the installation commands to the Dockerfile.

Also, as https://stackoverflow.com/a/66473309/12416058 suggests, Package python3-opencv includes all system dependencies of OpenCV. so installing it may prevent further errors.

To install python3-opencv;

apt-get update && apt-get install -y python3-opencv
pip install -r requirements.txt

To install in Dockerfile:

RUN apt-get update && apt-get install -y python3-opencv
RUN pip install -r requirements.txt
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.