树莓派导入opencv出错:ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.multiarray failed to import
·
利用pip3安装好opencv后,通过python3导入cv2的时候报错,如下:
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
这里是numpy库的版本过低或者过高,不合适刚刚装的opencv版本。
而如果我们是用的PIP装的最新版的opencv,即安装命令:
pip3 install opencv-python
pip3 install opencv_contrib-python
则说明numpy版本过低,所以我们应该安装最新版本:
命令: pip3 install -U numpy
pip安装太慢,解决办法:换源
目前,比较常用的pip镜像站点有:
1)清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
2)中科大:https://mirrors.ustc.edu.cn/pypi/web/simple/
3)豆瓣:http://pypi.doubanio.com/simple/
4)阿里云:http://mirrors.aliyun.com/pypi/simple/
pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
安装好即可导入opencv
更多推荐
所有评论(0)