0
点赞
收藏
分享

微信扫一扫

Python安装cv2库出错及解决:Could not find a version that satisfies the requirement cv2


今天怎么不灵了?初步判断是原来使用3.5,现在改用了2.7(项目需要)。

  • 解决办法一(网友提供)
pip3 install opencv-python
  • 解决办法二

  尝试运行命令:

pip install cv2
Collecting cv2
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

  看到这个错误,赶紧搜索,找到的办法都无法解决。于是怀疑查找的更新库有问题……可是为什么改了也不对?

  后来同事过来一看,直接搜索cv2,原来安装办法是:

sudo apt-get install python-opencv

# 同理,还有其他的:python-scipy/python-numpy/python-matplotlib/python-requests/python-skimage

  然后进python, import cv2,成功。

  查看版本号:

python -V
pip -V

filterpy可以直接用pip安装。

sudo pip2 install opencv-python

sudo pip2 install --upgrade pip

sudo pip install --upgrade pip


举报

相关推荐

0 条评论