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

原来的安装命令是:

https://blog.csdn.net/quantum7/article/details/81907553

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

 

尝试运行命令:

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

你可能感兴趣的:(Linux/Shell,Python/PyCharm)