I am rather new to python and am trying to run a written script that starts with
import numpy as np
When I run the script, it says it can't find the module numpy
.
How do I find and install new modules such as numpy
?
I am rather new to python and am trying to run a written script that starts with
import numpy as np
When I run the script, it says it can't find the module numpy
.
How do I find and install new modules such as numpy
?
The package manager for python (e.g equivalent to apt
for Ubuntu) is called pip. When you need to install a package, say numpy, you have to type pip install numpy.
python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
Macports:
sudo port install py35-numpy py35-scipy py35-matplotlib py35-ipython +notebook py35-pandas py35-sympy py35-nose
Homebrew:
python -m pip install numpy scipy matplotlib
Reference: https://www.scipy.org/install.html