问题报错:
import cv2
File "/root/anaconda3/envs/whw/lib/python3.8/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/root/anaconda3/envs/whw/lib/python3.8/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/root/anaconda3/envs/whw/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
opencv缺少该库,它是OpenGL的一部分,许多图形相关的应用程序和库都需要它。
解决方法(ubuntu版本):
sudo apt-get update
sudo apt-get install libgl1-mesa-glx