安裝完opencv-python後直接使用可能會遇到以下兩個錯誤,這是缺少運行文件,按照提示安裝即可,這裏稍微記錄一下。
ImportError: libSM.so.6: cannot open shared object file: No such file or directory
解決方法:apt-get install libsm6
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
解決方法:apt-get install libxrender1
ImportError: libXext.so.6: cannot open shared object file: No such file or directory
解決方法:apt-get install libxext-dev
注意你的系統可能以及安裝了某個版本的依賴導致安裝失敗,根據信息卸載重裝即可
我這邊使用的是python3