加油❤
安装cv2方式:python -m pip install opencv-python
之后进入python环境
>>> import cv2
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib64/python3.6/site-packages/cv2/__init__.py", line 181, in
bootstrap()
File "/usr/local/lib64/python3.6/site-packages/cv2/__init__.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/usr/lib64/python3.6/importlib/__init__.py", line 126, 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
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
[root@iZ8vb3jdbneqr0blsjqektZ ~]# pip3 install opencv-python-headless
安装 opencv-python-headless后,问题顺利解决