安装opencv后在Python中导入cv2时出错

2024-09-30 20:36:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经成功地安装了OpenCV,但是当我试图在Python中导入它时,我得到了以下错误。在

在Python2.7中,我得到了

[imukunya@li165-244 site-packages]$ python

Python 2.7.5 (default, Oct 30 2018, 23:45:53)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import cv2
>>> ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: numpy.core.multiarray failed to import

在python3.6中,我遇到了这个错误

^{pr2}$

我已经尝试过使用$~python3 -m pip install numpy -I安装NumPy


Tags: tocoreimportnumpydefaultpackages错误site