将cv2库导入python后,显示以下错误:

Traceback(most recent call):
file"<stdin>",line1,in <module>
Attribute Error:'module' object has no attribute '_version_'

我该怎么办?

最佳答案

您想要__version__,而不是_version_;)

import cv2;
>>> cv2._version_
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '_version_'
>>> cv2.__version__
'3.0.0-dev'
>>>

关于python - OpenCV导入错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27818742/

10-16 05:44