I'm using opencv-python-3.4.2.17 and opencv-contrib-python==3.4.2.16. I have tried other versions also. But I'm still getting this error:
sift = xfeatures2d.SIFT_create()
NameError: name 'xfeatures2d' is not defined
I have already referred to these links:
AttributeError: 'module' object has no attribute 'xfeatures2d' [Python/OpenCV 2.4]
Unable to find SIFT or xfeatures2d in OpenCV Python
Adding modules from opencv_contrib to OpenCV
But none of these worked for me.