Cannot import name 'graycomatrix' from 'skimage.feature'

Viewed 2132

I have successfully installed skimage packages but when I try to import the

from skimage.feature import graycomatrix, graycoprops

it results in an error saying:

cannot import name 'graycomatrix' from 'skimage.feature' (/Users/ain/opt/anaconda3/lib/python3.8/site-packages/skimage/feature/__init__.py)
2 Answers

Its name is greycomatrix. Syntax is

from skimage.feature import greycomatrix, greycoprops

To be more precise, to answer @smcs's comment and to update the accepted answer, from version 0.19 as seen in this pull request the functions are named graycomatrix and graycoprops and the documentation (github and docs) and the tutorial are correct.

To sum up. For skimage version 0.19 and above, this is the right import and version:

from skimage.feature import graycomatrix, graycoprops

and for older versions (but also till version 1.0 as mentioned in this issue) holds @Prasanth's answer:

from skimage.feature import greycomatrix, greycoprops
Related