[Python] Something wrong occurred when I import cv2

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    How this occurred: I wrote import cv2 in jupyter notebook code cell and run,then ImportError occurred.

    What I have tried: I have tried to uninstall opencv-python and opencv-contrib-python and reinstall opencv-python, but it didn't work.

    Detailed Error:

    ImportError Traceback (most recent call last)
    <ipython-input-1-7660ed0d4d71> in <module>
    ----> 1 import cv2
    2 import numpy as np
    3 import os
    4 from matplotlib import pyplot as plt
    5 import time

    D:\Anaconda3\lib\site-packages\cv2\__init__.py in <module>
    7
    8 from .cv2 import *
    ----> 9 from .cv2 import _registerMatType
    10 from . import mat_wrapper
    11 from . import gapi

    ImportError: cannot import name '_registerMatType' from 'cv2.cv2' (D:\Anaconda3\lib\site-packages\cv2\cv2.cp38-win_amd64.pyd)

    Continue reading...

Compartilhe esta Página