aws-samples / aws-iot-twinmaker-samples

Apache License 2.0
97 stars 77 forks source link

Cloud9: ImportError: libGL.so.1: cannot open shared object file: No such file or directory #17

Closed doronbl closed 2 years ago

doronbl commented 2 years ago

I'm setting up the environment on Cloud9 IDE, and getting the following error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Full trace:

python3 $GETTING_STARTED_DIR/src/modules/grafana/create_grafana_dashboard_role.py --workspace-id $WORKSPACE_ID --region $AWS_DEFAULT_REGION
Traceback (most recent call last):
  File "/home/ec2-user/environment/aws-iot-twinmaker-samples/src/modules/grafana/create_grafana_dashboard_role.py", line 11, in <module>
    import deploy_utils
  File "/home/ec2-user/environment/aws-iot-twinmaker-samples/src/modules/grafana/../../libs/deploy_utils/__init__.py", line 5, in <module>
    from .VideoUtils import *
  File "/home/ec2-user/environment/aws-iot-twinmaker-samples/src/modules/grafana/../../libs/deploy_utils/VideoUtils.py", line 12, in <module>
    import cv2
  File "/home/ec2-user/.local/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Environment: uname -a: Linux ip-.ec2.internal 4.14.256-197.484.amzn2.x86_64 #1 SMP Tue Nov 30 00:17:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux AMI: Cloud9AmazonLinux2-2021-12-11T02-42 AWS managed credentials: YES

Solution:

sudo yum install mesa-libGL
johnnyw-aws commented 2 years ago

Hi Doron, thanks for raising this!

We actually have this as a step in our setup for Cloud9: https://github.com/aws-samples/aws-iot-twinmaker-samples/blob/main/CLOUD9_SETUP.md?plain=1#L115-L123

But it seems easy for users to miss it accidentally. Wondering if you had any suggestions on ways we can simplify the setup or make it more visible

doronbl commented 2 years ago

Yep, seems I've missed the reference to this document. Since it is there, maybe the only thing I can suggest, is lowering the Cloud9 note to the Prerequisits section of the main README file.

johnnyw-aws commented 2 years ago

FYI: updated the README with your suggestion in https://github.com/aws-samples/aws-iot-twinmaker-samples/pull/33 Thanks!