OpenCV2 createBackgroundSubtractorMOG Attribute not found
there are two subtraction packages in opencv. BackgroundSubtractorMOG() it's at cv2.bgsegm.BackgroundSubtractorMOG(),to use you must install opencv-contrib-python
I am using cv2 version 4.0.0 and python version 3.7.2.
I am trying to subtract Background using this method cv2.createBackgroundSubtractorMOG2() and its working well.
But when I use cv2.createBackgroundSubtractorMOG() its not working its showing me 

AttributeError: module 'cv2.cv2' has no attribute
  'createBackgroundSubtractorMOG '.

I also tried cv2.BackgroundSubtractorMOG() but i got same error 

AttributeError: module 'cv2.cv2' has no attribute
  'BackgroundSubtractorMOG'.

and another subtraction method cv2.createBackgroundSubtractorGMG() also not working. 
I also refer other stackoverflow answers but I didn't get solution.