导入cv2非法值,无法导入



我使用的是带有pip版本20.3.1 的Python 3.9.0

我已经使用pip install opencv-python成功安装了numpy-1.19.4 opencv-python-4.0.46

然而,当我运行import cv2时,会出现无数错误

C:UsersUser11>python
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
** On entry to DGEBAL parameter number  3 had an illegal value
** On entry to DGEHRD  parameter number  2 had an illegal value
** On entry to DORGHR DORGQR parameter number  2 had an illegal value
** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
File "C:UsersUser11AppDataLocalProgramsPythonPython39libsite-packagesnumpy__init__.py", line 305, in <module>
_win_os_check()
File "C:UsersUser11AppDataLocalProgramsPythonPython39libsite-packagesnumpy__init__.py", line 302, in _win_os_check
raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\Users\User11\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.co....
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:UsersUser11AppDataLocalProgramsPythonPython39libsite-packagescv2__init__.py", line 5, in <module>
from .cv2 import *
ImportError: numpy.core.multiarray failed to import

我已经重新安装了python/nympy&openCV

我尝试了pip install -U numpy以修复`ImportError:numpy.core.multirarray无法导入

安装以前版本的numpy,1.19.3应该可以解决这个问题。python -m pip install numpy==1.19.3

最新更新