前言:
ubuntu下的opencv在引用的时候,会报错缺少依赖。解决方式根centos7下非gpu版略有不同,下面的内容是解决方法。
cv2的bug
ImportError: libXext.so.6: cannot open shared object file: No such file or directory
解决步骤:
原因是缺少共享文件库,解决办法如下:
- 安装apt-file
# apt-get update
# apt-get install apt-file
# apt-file update
- 查找依赖库
apt-file search libXext.so.6
- 安装
apt-get install libxext6
参考文章:https://blog.csdn.net/yjk13703623757/article/details/93673927
使用apt-file安装缺少的依赖库https://blog.csdn.net/gatieme/article/details/52137359?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase