reiinakano / scikit-plot

An intuitive library to add plotting functionality to scikit-learn objects.
MIT License
2.43k stars 284 forks source link

Bug: Failing to import Scikitplot fails due to ImportError #119

Open radlfabs opened 7 months ago

radlfabs commented 7 months ago

Hey @reiinakano,

first, your work was a great addition to the open-source ML community and is still used. 👍 Unfortunately, importing a freshly installed scikit-plot now fails with the following ImportErrror:

import scikitplot
print("Hello World")

import scikitplot Traceback (most recent call last): File "", line 1, in File "D:\test-scikitplot\skplot\Lib\site-packages\scikitplot__init.py", line 2, in from . import metrics, cluster, decomposition, estimators File "D:\test-scikitplot\skplot\Lib\site-packages\scikitplot\metrics.py", line 27, in from scipy import interp ImportError: cannot import name 'interp' from 'scipy' (D:\test-scikitplot\skplot\Lib\site-packages\scipy\init__.py)

So what fails is https://github.com/reiinakano/scikit-plot/blob/2dd3e6a76df77edcbd724c4db25575f70abb57cb/scikitplot/metrics.py#L27

The interp-function can be imported from numpy instead. This bug is severe, because it affects all packages trying to import scikit-plot at the moment. I would highly appreciate you looking into this! Thanks a lot and best wishes!

akosmaroy commented 6 months ago

is there a workaround for this in the meantime?

pplonski commented 5 months ago

Please install scipy==1.11.4 to fix this issue.

linviaz commented 5 months ago

A bit late in the conversation, but I created a pull request here to fix the issue: https://github.com/reiinakano/scikit-plot/pull/120

pplonski commented 4 months ago

I created a fork with @linviaz PR, I will maintain it https://github.com/mljar/mljar-scikit-plot