ImportError: cannot import name 'structural_similarity' error

Please check your skimage version.

https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.compare_ssim

Changed in version 0.16: This function was renamed from skimage.measure.compare_ssim to skimage.metrics.structural_similarity.

Hope it helps.


I found the solution. As this question is unique and not covered anywhere. So, posting the answer.

#from skimage.measure import structural_similarity as ssim
from skimage import measure
.
.
.
#s = ssim(imageA, imageB)
s = measure.compare_ssim(imageA, imageB)

Change commented line to uncommented line.