I am creating a face recognition system using Python and OpenCV on these versions:
this should fix the problem
pip install opencv-python-headless pip install opencv-contrib-python-headless