pip2 install 'opencv-python<3.4' 总是装不上,报错

这里须要编译caffe的python接口,而后训练的时候报错,报错内容显示是opencv的问题。
可是在终端下面python,再import cv2,再读取一张图片是能够的。
但是训练就报错,也不知道用的哪里的opencv。
pip2 install 'opencv-python<3.4'
装不上,报错。
using cached https://files.pythonhosted.org/packages/55/9d/df--/opencv-python-3.3.1.11-cp27-cp27mu-manylinux1_x86_64.whl
collecting numpy>=1.11.1(from opencv-python<3.4)
using cached https://files.pythonhosted.org/packages/0b/a7/e724--/numpy-1.21.1.zip
complete output from command python setup.py egg_info:
Traceback (most recent call last):
File " ", line 1,in
File "/tmp/pip-build-oX8GVw/numpy/setup.py",line 34, in
raise RuntimeError("python version >= 3.7 required. ")
RuntimeError:Python version >= 3.7 required.
python

pip 死活装不上,百度了各类方法都很差使,而后必应搜了一下,第一个就解决了问题!
https://blog.csdn.net/weixin_39298885/article/details/117918699linux

python2配套的pip,有些pypi包没法正常安装。

我须要安装Caffe1.0,是基于Python2的。须要opencv库,用命令pip install opencv-python,提示错误
RuntimeError: Python version >= 3.7 required.
这是由于numpy版本太高,没法在python2环境中安装,可是opencv-python又须要这个库。用下面的命令能够完美解决。

pip install opencv-python==3.3.0.9 numpy==1.16.6
相关文章
相关标签/搜索