树莓派pip安装opencv报错,Could not find a version that satisfies the requirement cv2 (from versions: )No matching distribution found for

树莓派pip安装opencv报错,Could not find a version that satisfies the requirement cv2 (from versions: )No matching distribution found for,第1张

概述前言 我在使用pip install opencv-python 时报错 Could not find a version that satisfies the requirement opencv (from versions: ) No matching distribution found for opencv 树莓派的镜像是默认装的镜像,没怎么装过其他东西的。我查看了python的版本,p 前言

我在使用pip install opencv-python 时报错

Could not find a version that satisfIEs the requirement opencv (from versions: ) No matching distribution found for opencv

树莓派的镜像是默认装的镜像,没怎么装过其他东西的。我查看了python的版本,python是2.7版本的,ubuntu镜像默认是装好了python2。分析原因,应该是python2版本过久,无法找到满足opencv需求的版本。然后我将python2 升级到python3后安装,发现安装成功。

具体 *** 作

1.执行 sudo apt-get install python3 命令安装python3

sudo apt-get install python3

 

2.执行 python3 -V 查看 python3是否安装成功

python3 -V

 

3.执行 pip3 install opencv-python

pip3 install opencv-python

 

安装好后如图

 

 

4.执行 pip3 List 验证 pip3中是否安装了opencv-python

pip3 List
   


(检验pip3中是安装了opencv-python)

 

5.进入python3 执行 import cv2 as cv 查看opencv-python 是否成功安装进python3

python3import cv2 as cv 
   


(查看opencv-python 是否成功安装进python3)

 

此时出现了个坑,报错:importError:libcblas.so.3:cannot open shared object file:No such file or directory
这个报错的意思是没有安装libcblas的库,此时安装Blas 的依赖项就解决了。安装libcblas库的命令是:

sudo apt-get install libatlas-base-dev

sudo apt-get install libgflags-devsudo apt-get install libgoodle-glog-devsudo apt-get install liblmdb-devsudo apt-get install pythonsudo apt-get install python-devsudo apt-get install python-numpysudo apt-get install ipythonsudo apt-get install ipython-notebooksudo apt-get install python-sklearnsudo apt-get install python-skimagesudo apt-get install python-protobuf

 

这里演示 命令 sudo apt-get install libatlas-base-dev


(安装Blas 的依赖项)

 

6.再次进入python3 执行 import cv2 as cv 查看opencv-python 是否成功安装进python3
(若第五步遇到坑则执行第六步)

 


(安装完成) 总结

以上是内存溢出为你收集整理的树莓派pip安装opencv报错,Could not find a version that satisfies the requirement cv2 (from versions: )No matching distribution found for cv2全部内容,希望文章能够帮你解决树莓派pip安装opencv报错,Could not find a version that satisfies the requirement cv2 (from versions: )No matching distribution found for cv2所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1191572.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-03
下一篇2022-06-03

发表评论

登录后才能评论

评论列表(0条)

    保存