ImportError - Unable to Import 'interp' from SciPy Module

1.1k Views Asked by At

I encountered an ImportError while attempting to import PyCaret's classification module:

from pycaret.classification import*

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

This error occurs when Python is unable to find the interp function within the SciPy library.

It seems that PyCaret's classification module relies on the 'interp' function from SciPy, but for some reason, Python is unable to locate it. This could be due to a version mismatch or a corrupted installation of the SciPy library.

How to resolve this issue?

2

There are 2 best solutions below

0
Rafael Sanabria On

This happened because there was a minor version release of SciPy 1.12.0 with breaking changes. You could fix this by installing the previous version with the command pip install scipy==1.11.4

0
Salio On

This happens when you install :

pip install scipy #--> latest version 

If you check the version:

import scipy
print(scipy.__version__)

output:

scipy 1.12.0

So you should use the following command:

%pip install scipy==1.11.4