当前位置:首页 > 编程笔记 > 正文
已解决

ubuntu20.04安装cv2

来自网友在路上 159859提问 提问时间:2023-11-18 23:25:36阅读次数: 59

最佳答案 问答题库598位专家为你答疑解惑

查看ubuntu的版本

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

更改镜像源

cp /etc/apt/sources.list /etc/apt/sources.list.bak
cat > /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

安装opencv

apt install python3 python3-pip
apt install python3-opencv

测试opencv是否安装完成
在这里插入图片描述

win下安装

pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install pytorch torchvision torchaudio cpuonly 
查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"ubuntu20.04安装cv2":http://eshow365.cn/6-38739-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!