I am getting import error: module named numpy. Does this mean i have to install numpy? I have downloaded the new version extracted it into home. I am not sure what else to do. I am using Ubuntu 16.04. I have also tried:

sudo apt-get install python-pip
sudo apt-get install python3-numpy

But the error remains. Can anyone kindly guide me how to solve this

  • Please post the exact error message, and how you import numpy. Also: what is the python version you are using in the script, and how are you exactly running (calling) the script? – Jacob Vlijm May 23 '17 at 5:54
  • 1
    are you sure that your program uses python3? You might need to install python-numpy with sudo apt-get install python-numpy if your program uses python2 instead. – sid-m May 23 '17 at 5:58

Are you sure that you are not trying to import numpy for Python 3.x into a Python 2.x program? In Ubunto 20.04 and earlier open the terminal and type:

sudo apt install python-numpy  

If this works, it is the logical reverse of this answer.


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.