Solution:
1. Reduce the version of opencv-python
pip install opencv-python==3.4.2.16 -i https://pypi.doubanio.com/simple/
pip install opencv-contrib-python==3.4.2.16 -i https://pypi.doubanio.com/simple/
2. Change the function name
sift = cv2.xfeatures2d.SIFT_create()
Change to:
sift = cv2.SIFT_create()