近期採用Docker,發現常常在安裝套件遇到一些錯誤問題,在此記錄一下:
錯誤一 :SSL相關錯誤
1 |
ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory |
解法:
這問題是在ubuntu上發生,一該是缺少某些ssl套件,可以用以下指令試試看
1 2 |
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb |
再重新安裝套件應該就可以了
錯誤二: skimage錯誤
1 2 3 4 5 6 7 8 9 10 |
exit code: 1 L-> 13 lines of output] *** Please install the 'scikit-image' package (instead of 'skimage') *** [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. L-> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. |
解法:這問題是要安裝skimage套件,但他實際的全名是scikit-image 所以應該用他的全名進行安裝即可
1 |
pip install scikit-image |
錯誤三:docx之類套件錯誤
解法:這種問題通常是發生在pip install 是成功的但執行的時候卻不能用,可能是剛好有同名稱的套件,但你要用的套件是以不同名稱存在,通常前面加上python-有可能對
1 |
pip install python-docx |
錯誤四:opencv相關
1 |
ImportError: libGL.so.1: cannot open shared object file: No such file or directory |
解法:安裝相關套件
1 |
apt install libgl1-mesa-glx |