mljar / mljar-supervised

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation
https://mljar.com
MIT License
2.97k stars 392 forks source link

ImportError: cannot import name 'interp' from 'scipy' #691

Open haim-cohen-moonactive opened 5 months ago

haim-cohen-moonactive commented 5 months ago

On January 20th, 2024 scypi released version 1.12.0 which broke its compatibility withthe old scikit-plot version 0.37, used by mljar-supervised. Since then, when importing AutoML (from supervised.automl import AutoML) you get the following error:

ImportError: cannot import name 'interp' from 'scipy' (/Users/someuser/temp/venv/lib/python3.9/site-packages/scipy/__init__.py)

It also happens on Python 3.11.7.

WORKAROUND: Add to requirements.txt scipy==1.11.4, which installs the previous version of scipy.

@pplonski, long-term I guess replacing scikit-plot should take place, as it stopped developing on 2018. As a a quick fix for now, I would add the following to requirements.txt

scipy>=1.6.1,<=1.11.4

instead of scipy>=1.6.1

Thanks!

namelessperson0 commented 5 months ago

I am also facing the same error. ImportError: cannot import name 'interp' from 'scipy'

pplonski commented 5 months ago

Thank you @haim-cohen-moonactive, I've added limit for scipy version. I will take a look at scikit-plot as well.

cmontesv commented 4 months ago

any clue when requirements.txt file doesn't exist? thanks

haim-cohen-moonactive commented 4 months ago

any clue when requirements.txt file doesn't exist? thanks

@cmontesv Just install scipy==1.11.4. If inside a notebook: %pip install scipy==1.11.4

This will make mljar work again.

cmontesv commented 4 months ago

any clue when requirements.txt file doesn't exist? thanks

@cmontesv Just install scipy==1.11.4. If inside a notebook: %pip install scipy==1.11.4

This will make mljar work again.

it worked, thank you very much

lzzzhh commented 4 months ago

there is an error ImportError: cannot import name 'reshape' from 'scipy', my scipy version is 1.12.0, python version is 3.9, what version of scipy is suitable for me then i change my scipy version to 1.6.1, an new error:ImportError: cannot import name 'expm2' from 'scipy.linalg' Thank!

pplonski commented 4 months ago

Please install scipy 1.11.4, I will fix it tomorrow and do new release.

dvsuresh26 commented 3 weeks ago

Getting same [ImportError: cannot import name 'interp' from 'scipy'] error even after installing scipy-1.11.4

pplonski commented 3 weeks ago

Please update mljar-supervised to the latest version.

rafael-ferreira-soares commented 4 days ago

Try replacing the line "from scipy import interp" to "from numpy import interp" in the files "metrics.py" and "plotters" below: conda/envs/scipy/lib/python3.10/site-packages/scikitplot/metrics.py conda/envs/scipy/lib/python3.10/site-packages/scikitplot/plotters.py

The paths and names may be different in your installation.

It worked for me.