cannot import name ‘_registerMatType’ from ‘cv2.cv2’

We Are Going To Discuss About cannot import name ‘_registerMatType’ from ‘cv2.cv2’. So lets Start this Python Article.

cannot import name ‘_registerMatType’ from ‘cv2.cv2’

  1. How to solve cannot import name '_registerMatType' from 'cv2.cv2'

    The same thing occurred to me yesterday when I used Colab. A possible reason may be that the version of opencv-python(4.1.2.30) does not match opencv-python-headless(4.5.5.62). Or the latest version 4.5.5 may have something wrong…
    I uninstalled opencv-python-headless==4.5.5.62 and installed 4.1.2.30 and it fixed.

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

    The same thing occurred to me yesterday when I used Colab. A possible reason may be that the version of opencv-python(4.1.2.30) does not match opencv-python-headless(4.5.5.62). Or the latest version 4.5.5 may have something wrong…
    I uninstalled opencv-python-headless==4.5.5.62 and installed 4.1.2.30 and it fixed.

Solution 1

The same thing occurred to me yesterday when I used Colab. A possible reason may be that the version of opencv-python(4.1.2.30) does not match opencv-python-headless(4.5.5.62). Or the latest version 4.5.5 may have something wrong…

I uninstalled opencv-python-headless==4.5.5.62 and installed 4.1.2.30 and it fixed.

Original Author Asaka Of This Content

Solution 2

The same thing occurred to me. My status:

C:\Windows\system32>pip list |findstr opencv
opencv-python                 4.5.2.52
opencv-python-headless        4.5.5.62

The version isn’t same. So I first uninstall headless:

pip uninstall opencv-python-headless==4.5.5.62

Then reinstall headless 4.5.2.52 with opencv-python package.

pip install opencv-python-headless==4.5.2.52

The problem is the resolved.

Original Author 杨贤文 Of This Content

Solution 3

Try uninstall and install(version 4.1.2.30) Headless main modules package

!pip uninstall opencv-python-headless
!pip install opencv-python-headless==4.1.2.30

Original Author Chamindu Weerasinghe Of This Content

Solution 4

I’ve had the same issue and the problem was with opencv versioning:

C:\Windows\system32>pip list |findstr opencv
opencv-python                 4.5.2.52
opencv-python-headless        4.5.5.62

As you can see the versions are not the same, so first uninstall headless:

pip uninstall opencv-python==4.5.2.52

And then reinstall opencv-python 4.5.5.62 with opencv-python package:

pip install opencv-python-headless==4.5.5.62

Original Author aman Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment