Hand tracking not working with kinect v2

there is no kinect support built into opencv by default,
you have to build the opencv libs from src, with the kinect/openni sdk.
then, you can use

cap = cv2.VideoCapture(0, cv2.CAP_OPENNI2)