加油❤🤞💕
报错情况
安装cv2方式:python -m pip install opencv-python
之后进入python环境
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib64/python3.6/site-packages/cv2/__init__.py", line 181, in <module>
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
pip3 install opencv-python-headless
文章来源:https://www.toymoban.com/news/detail-739049.html
安装 opencv-python-headless后,问题顺利解决文章来源地址https://www.toymoban.com/news/detail-739049.html
到了这里,关于import cv2 报错(linux环境)ImportError: libGL.so.1: cannot open shared object file: No such file or direc的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!