I need help with installing numpy to Ubuntu 16.04. after:

$ pip3 install numpy
come up always:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/numpy'

What to do? How can i install numpy?

  • 2
    What's wrong with sudo apt-get install python3-numpy? – muru Apr 30 '16 at 16:11
  • sudo pip3 install numpy. – Karl Richter May 1 '16 at 9:05

See, when you install any software using pip, it defaults to the path: "/usr/local/lib/python3.5/dist-packages/numpy" for installing that software.

Only the root user has access to this area of control (better security) and so, you'll need to the keyword sudo before such commands to enable that software (in this case, pip) to perform it's operations with a root user access level.

So, your command will now become:

sudo pip3 install numpy
| improve this answer | |
  • It worked well... i am a beginner and going trough python course... trying to follow what is there. learning every day something new Thank you. – Tukadas Apr 30 '16 at 16:56
  • 2
    Why not pip3 install --user numpy? – muru Apr 30 '16 at 18:55
  • @Tukadas if this answer helped you solve the problem, then choose it as the best answer for other users in the future :) – Surya Teja Karra May 1 '16 at 6:38

From the terminal run:

sudo apt-get install python3-numpy

This package contains Numpy for Python 3.

For scipy:

sudo apt-get install python3-scipy

For for plotting graphs use pylab:

sudo apt-get install python3-matplotlib
| improve this answer | |
  • similarly, I could have installed Pandas: sudo apt-get install python3-pandas and followed by I verified as python3 -c "import numpy, pandas, matplotlib, scipy" it worked for me. Thanks – Grijesh Chauhan Nov 5 '19 at 8:02

I have also installed numpy library easily using install pip on ubuntu. you should enter the following command:

sudo pip3 install numpy

| improve 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.