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.0 But when I tried to import them in my code I got the following error.

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_FromObject

I tried to install the numpy again with the same way and the result was the same. Can you please help me solve this?


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 numpy

and if not, then this:

sudo apt install libatlas-base-dev libatlas3-base libopenblas-base libopenblas-dev

and try the above again.

  • I uninstalled them successfully. I used pip install scipy but it didn't work, so I tried with pip install --user scipy and it worked. After pip install numpy it looks like numpy was already installed with scipy. Also, I got some RequestsDependencyWarning but when I try to import numpy and scipy in IDLE's terminal everything works fine. So that worked for me! Sep 8 '18 at 15:26
  • Good to know! Have a great day! Sep 9 '18 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.