I tried to install numpy using: pip install numpy
It worked, but I got a warning: warnings.warn(warning, RequestsDependencyWarning).
Then I tried to install scipy with: python -m pip install --user scipy and it worked. I've checked my packages list with: pip freeze and both of them where on the list: numpy==1.15.1 scipy==1.1.0But when I tried to import them in my code I got the following error.
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.Original error was:
/home/spyros/.local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_FromObjectI tried to install the numpy again with the same way and the result was the same. Can you please help me solve this?
2 Answers
To install it for python 2.x, this works for me on ubuntu 18.04:sudo apt-get install python-scipy
Disclaimer: the best one I know of... O.K. Try this (based one experience in the past with Ubuntu + this and a little google.)
pip uninstall numpy
pip uninstall spicy
pip install spicy
pip install numpyand if not, then this:
sudo apt install libatlas-base-dev libatlas3-base libopenblas-base libopenblas-devand try the above again.
2