NumPy is an open-source library/package for Python. It is used for scientific/analytic solution.
Apart from its multidimensional array it provide height-level functioning tools for work with array.
In this tutorial you will learn how to install NumPy.
Prerequisites
- Installed Python on your system.
- Terminal/commend line access.
Installing NumPy
Follow the bellow steps to complete installing process.
Step 1 : Check the Python Version
Before you can install NumPy, you need to know which python version you have.
Most provably you have python 2 or python 3 or even both version.
To check whether Python version you have, run the bellow commend
python -V
Output will as bellow -
Python 3.9.6
Step 2 : Check pip version
Check the pip version you have installed as bellow commend -
pip -V
Output will as bellow -
pip 21.1.3 (python 3.9)
Step 3 : Install NumPy
With pip you can install NumPy by commend line commend as bellow -
pip install numpy
OR
python -m pip install numpy
Step 4 : Verify NumPy Installation
Verify NumPy is properly installed by show commend as bellow -
pip show numpy
then you will show the output and confirm you have NumPy, which version you have.
Step 5 : Import NumPy Package
After installing NumPy package, you can import the package and set a alis for the package as bellow -
import numpy as np
For upgrading NumPy Package
If you have a old NumPy installed version and you want to upgrade the version, you can do the as bellow -
pip install numpy --upgrade
By following this guide you should have successfully installed NumPy on your system. If this article was helpful leave a comment.