Closed ehusby closed 1 year ago
I think oddly enough, this was the one dependency we decided was this one function, was not a reason to drag in a heavy dependency, by default to all users of scikit-image.
I think you might be able to follow the decision process https://github.com/scikit-image/scikit-image/pull/5990
But TLDR, you need to install matplotlib yourself if you want to use this one function.
Yep. mpl is optional and that is not a bug. See https://github.com/scikit-image/scikit-image/blob/main/pyproject.toml#L106-L113
Got it! I wonder if there's a standard way of making that more obvious in either the scikit-image source code, or in this conda-forge feedstock. It's only a little concerning to discover this at runtime.
It's only a little concerning to discover this at runtime.
Why? The error message tells you that mpl is missing and it is easy to solve by installing it. All Python packages use that logic for optional dependencies. If you are pip-installing you can add all the optional packages with the pip install scikit-image[optional]
syntax. Note that there is no way for the end user to find out the names of the optional "options" without reading the package metadata.
This can be improved by adding code to scikit image.
Just, it is "one more thing" and as ocefpaf said, is it any different than the provided error message? Adding more code, more features, more options, generally adds maintenance burden.
It's a delicate balance
Solution to issue cannot be found in the documentation.
Issue
Test environment was created with the following command:
matplotlib
is a required package for someskimage
functions such asskimage.draw.polygon_perimeter
. Below is an example usage that raises the error.If I manually install the
matplotlib
package into the conda environment, then there is no error.For reference, here are the contents of my
~/.condarc
file:Installed packages
Environment info