'Having trouble importing cv2, outputting an importerror

Input

Trying to import these libraries and cv2 is throwing an error:

import argparse
import cv2
from datetime import datetime
import keyboard as key
import imutils
import mediapip as mp
import numpy as np
import os
import pandas as pd
from PIL import Image
import sys
import time

This is the error returned:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-ee20a49702d1> in <module>
      1 import argparse
----> 2 import cv2
      3 from datetime import datetime
      4 import keyboard as key
      5 import imutils

~/opt/anaconda3/lib/python3.8/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' (/Users/ryleigh_grove/opt/anaconda3/lib/python3.8/site-packages/cv2/cv2.cpython-38-darwin.so)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source