close

[Solved] ImportError: cannot import name ‘_registerMatType’ from ‘cv2.cv2’

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use Object Detection API But I am facing following error ImportError: cannot import name ‘_registerMatType’ from ‘cv2.cv2’ in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How ImportError: cannot import name ‘_registerMatType’ from ‘cv2.cv2’ Error Occurs ?

I am trying to use Object Detection API But I am facing following error.

ImportError: cannot import name '_registerMatType' from 'cv2.cv2'

How To Solve ImportError: cannot import name ‘_registerMatType’ from ‘cv2.cv2’ Error ?

  1. How To Solve ImportError: cannot import name '_registerMatType' from 'cv2.cv2' Error ?

    To Solve ImportError: cannot import name '_registerMatType' from 'cv2.cv2' Error You just have to Downgrade opencv-python-headless to the 4.1.2.30 Because of opencv-python(4.1.2.30) does not match opencv-python-headless latest version and thats why this error occurs. So first of all Just uninstall opencv-python-headless with this command: pip uninstall opencv-python-headless and now, install opencv-python-headless==4.1.2.30 with this command: pip install opencv-python-headless==4.1.2.30 Now, Your error must be solved.

  2. ImportError: cannot import name '_registerMatType' from 'cv2.cv2'

    To Solve ImportError: cannot import name '_registerMatType' from 'cv2.cv2' Error You just have to Downgrade opencv-python-headless to the 4.1.2.30 Because of opencv-python(4.1.2.30) does not match opencv-python-headless latest version and thats why this error occurs. So first of all Just uninstall opencv-python-headless with this command: pip uninstall opencv-python-headless and now, install opencv-python-headless==4.1.2.30 with this command: pip install opencv-python-headless==4.1.2.30 Now, Your error must be solved.

Solution 1: Downgrade opencv-python-headless

You just have to Downgrade opencv-python-headless to the 4.1.2.30 Because of opencv-python(4.1.2.30) does not match opencv-python-headless latest version and thats why this error occurs.

So first of all Just uninstall opencv-python-headless with this command.

pip uninstall opencv-python-headless

and now, install opencv-python-headless==4.1.2.30 with this command.

pip install opencv-python-headless==4.1.2.30

Now, Your error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment