big sur – Reinstall python 2.7.16 librairies on MacOS Big Sur 11.3

To confirm results of a colleague who has coded an interpolation with Cubicspline from scipy with python2 , I have to import CubicSpline function. I know python2 is deprecated but this is just for a validation.

But when i do a :

from scipy.interpolate import CubicSpline

I have systematically the error message :

ImportError: cannot import name CubicSpline

So, I tried to install it with pip-2.7 by doing :

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py

python2.7 get-pip.py

and after from the directory ~/Library/Python/2.7/bin :

./pip2.7 install scipy

but same error, CubicSpline is not found

I have the version :

$ which python2.7
/usr/bin/python2.7

So python2.7 is the default python2 of the system.

How to install CubicSpline library on the default installation of python2.7 in the OS ?

Have I got to reinstall all the python2.7 framework ? and if yes, how to perform it ?