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
and after from the directory
./pip2.7 install scipy
but same error,
CubicSpline is not found
I have the version :
$ which 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 ?
UPDATE : the situation has become worse :
After doing :
$ python2.7 -m pip install scipy numpy
I get now :
Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10)
(GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)) on darwin
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/Users/fab/.startup.py", line 3, in <module>
import numpy as np
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 71, in <module>
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/_multiarray_umath.so, 2): Symbol not found: ___addtf3
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/../.dylibs/libquadmath.0.dylib
Expected in: /usr/lib/libSystem.B.dylib