NumPy doesn't come bundled with Python. We have to install it using the python pip installer. Execute the following command.
$ pip install numpy
It is best practice to install NumPy with the full SciPy stack. The binary distribution of the SciPy stack is specific to the operating systems.
On the Windows operating system, The SciPy stack is provided by the Anaconda which is a free distribution of the Python SciPy package.
It can be downloaded from the official website: https://www.anaconda.com/. It is also available for Linux and Mac.
The CanoPy also comes with the full SciPy stack which is available as free as well as commercial license. We can download it by visiting the link: https://www.enthought.com/products/canopy/
The Python (x, y) is also available free with the full SciPy distribution. Download it by visiting the link: https://python-xy.github.io/
In Linux, the different package managers are used to install the SciPy stack. The package managers are specific to the different distributions of Linux. Let's look at each one of them.
Execute the following command on the terminal.
$ sudo apt-get install python-numpy $ python-scipy python-matplotlibipythonipythonnotebook python-pandas $ python-sympy python-nose
On Redhat, the following commands are executed to install the Python SciPy package stack.
$ sudo yum install numpyscipy python-matplotlibipython $ python-pandas sympy python-nose atlas-devel
To verify the installation, open the Python prompt by executing python command on the terminal (cmd in the case of windows) and try to import the module NumPy as shown in the below image. If it doesn't give the error, then it is installed successfully.