在导入opencv包时报错: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 "/root/anaconda3/envs/vvd_env/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
直接下载下面包即可:
apt update
apt install libgl1-mesa-glx
或者:
sudo apt update
sudo apt install libgl1-mesa-glx
安装完上面的包后还可能报错:
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
在安装一个包即可:
apt-get install libglib2.0-dev