If you have something like this erorr's (These error's was in PyCharm too, i just dont screenshot them in PyCharm)

And if you are using PyCharm, try use this:
As rems02 say's - "If you have this error:
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback.
-You must replace line 3
"cam = cv2.VideoCapture(1)"
with
"cam = cv2.VideoCapture(0, cv2.CAP_DSHOW)"
And for the 2-nd part of problem, you need uninstall "mediapipe" that you have, and install other one in pycharm. For my python 3.7.9 i swapped to mediapipe 0.8.8 - (File - settings - projects - python interpreter)
If you have something like this erorr's (These error's was in PyCharm too, i just dont screenshot them in PyCharm)

And if you are using PyCharm, try use this:
As rems02 say's - "If you have this error:
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback.
-You must replace line 3
"cam = cv2.VideoCapture(1)"
with
"cam = cv2.VideoCapture(0, cv2.CAP_DSHOW)"
And for the 2-nd part of problem, you need uninstall "mediapipe" that you have, and install other one in pycharm. For my python 3.7.9 i swapped to mediapipe 0.8.8 - (File - settings - projects - python interpreter)