出错提示ImportError: libGL.so.1: cannot open shared object file: No such file or directory。
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/.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
解决问题
环境是ubuntu16.04。
指令:
sudo apt update
sudo apt install libgl1-mesa-glx
就ok了
可能容器内没有sudo指令
可以
apt-get update
apt-get install sudo