linux安装cv2踩坑
pip安裝命令:
pip install opencv-python
pip install opencv-contrib-python
若報(bào)錯(cuò)可以使用清華源安裝cv2:pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
還下不下來那就都這個(gè)網(wǎng)站下:https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/opencv-python/
還不不行試試wget,把上面那個(gè)網(wǎng)址復(fù)制下來 wget + 鏈接?
老子被下載折騰半天,哭死
?
import cv2的錯(cuò)誤記錄:
1、cv2 ImportError: libGL.so.1: cannot open shared object file: No such file or directory
缺少相關(guān)依賴項(xiàng),需要更新安裝,執(zhí)行命令:
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev
?
2、若執(zhí)行sudo apt-get update報(bào)如下錯(cuò):
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目錄的權(quán)限即可:chmod 777 /tmp
與50位技術(shù)專家面對(duì)面20年技術(shù)見證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的linux安装cv2踩坑的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android cpu绑核
- 下一篇: Tensorflow—tfrecord数