linux安装cv2踩坑
pip安裝命令:
pip install opencv-python
pip install opencv-contrib-python
若報錯可以使用清華源安裝cv2:pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
還下不下來那就都這個網站下:https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-python/
還不不行試試wget,把上面那個網址復制下來 wget + 鏈接?
老子被下載折騰半天,哭死
?
import cv2的錯誤記錄:
1、cv2 ImportError: libGL.so.1: cannot open shared object file: No such file or directory
缺少相關依賴項,需要更新安裝,執行命令:
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev
?
2、若執行sudo apt-get update報如下錯:
Get:1 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]
Err:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
? Couldn't create temporary file /tmp/apt.conf.g1YDx9 for passing config to apt-key
打開/tmp目錄的權限即可:chmod 777 /tmp
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的linux安装cv2踩坑的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android cpu绑核
- 下一篇: Tensorflow—tfrecord数