Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ImportError: cannot import name greycomatrix from skimage.feature" in sct_analyze_texture #4056

Closed
joshuacwnewton opened this issue Mar 2, 2023 · 1 comment · Fixed by #4057
Assignees
Labels
bug category: fixes an error in the code maintenance sct_analyze_texture context: upstream Issue caused by software dependencies
Milestone

Comments

@joshuacwnewton
Copy link
Member

Issue experienced in our scheduled tests starting yesterday, as well as new PRs (e.g. #4055)

_________ ERROR collecting testing/cli/test_cli_sct_analyze_texture.py _________
ImportError while importing test module '/__w/spinalcordtoolbox/spinalcordtoolbox/testing/cli/test_cli_sct_analyze_texture.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
python/envs/venv_sct/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
testing/cli/test_cli_sct_analyze_texture.py:7: in <module>
    from spinalcordtoolbox.scripts import sct_analyze_texture
spinalcordtoolbox/scripts/sct_analyze_texture.py:17: in <module>
    from skimage.feature import greycomatrix, greycoprops
E   ImportError: cannot import name 'greycomatrix' from 'skimage.feature' (/__w/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/skimage/feature/__init__.py)

I presume greycomatrix was deprecated, and skimage updated to a version that removed this feature.

I'll do some more digging shortly. :)

@joshuacwnewton joshuacwnewton added bug category: fixes an error in the code upstream Issue caused by software dependencies maintenance labels Mar 2, 2023
@joshuacwnewton joshuacwnewton added this to the 6.0 milestone Mar 2, 2023
@joshuacwnewton joshuacwnewton self-assigned this Mar 2, 2023
@joshuacwnewton joshuacwnewton changed the title ImportError: cannot import name 'greycomatrix' from 'skimage.feature' in sct_analyze_texture "ImportError: cannot import name 'greycomatrix' from 'skimage.feature'" in sct_analyze_texture Mar 2, 2023
@joshuacwnewton joshuacwnewton changed the title "ImportError: cannot import name 'greycomatrix' from 'skimage.feature'" in sct_analyze_texture "ImportError: cannot import name greycomatrix from skimage.feature" in sct_analyze_texture Mar 2, 2023
@joshuacwnewton
Copy link
Member Author

joshuacwnewton commented Mar 2, 2023

skimage=0.20.0 was released yesterday. Its release notes contain the following:

  • Remove deprecated functions greycomatrix and greycoprops from skimage.feature (#6583).

The specific commit within that PR is scikit-image/scikit-image@171d34a.

It looks like the deprecation is simply about changing the word grey to gray, so all we'll have to do is update a single letter. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: fixes an error in the code maintenance sct_analyze_texture context: upstream Issue caused by software dependencies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant