cannot import name '_registerMatType' from 'cv2.cv2' (/usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)

Viewed 2290

I got below error message when I run some codes according to Google Colab:'cannot import name '_registerMatType' from 'cv2.cv2' (/usr/local/lib/python3.7/dist-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)'. And I tried to uninstall the opencv-python-headless==4.5.5.62 and installing opencv 4.1.2.30 using the following lines:'!pip uninstall opencv-python-headless==4.5.5.62 !pip install opencv-python==4.1.2.30 'but it seemed that the new version wasn't installed because it then said'no module named cv2'. How should I do to fix this problem?

1 Answers
!pip uninstall opencv-python-headless==4.5.5.62 
!pip install opencv-python-headless==4.1.2.30

worked for me

Related