How To Install NumPy in Python

How To Install NumPy in Python?

Last updated on 13th Oct 2020, Artciles, Blog

About author

Prakash (Sr Technical Project Manager - Python )

He is a TOP-Rated Domain Expert with 11+ Years Of Experience, Also He is a Respective Technical Recruiter for Past 5 Years & Share's this Informative Articles For Freshers

(5.0) | 12547 Ratings 2313

How to install Numpy in Python 3.7 in Windows 10

What is Numpy? and how to install Numpy, Scipy, Matplotlib, iPython, Jupyter, Pandas, Sympy and Nose on Windows 10/8 or Windows 7 using Python PiP. Here in this article, we discuss it.

Quite simply, Numpy is a scientific computing library for Python that provides the functionality of matrix operations, which are generally used with Scipy and Matplotlib. In fact, the list already provides a matrix-like representation, but it provides us with more functions. If you have using Matlab, Scilab, then this tool is very good for you.

Subscribe For Free Demo

Error: Contact form not found.

Numpy is one of the basic libraries that must be mastered for data analysis in Python. It can be used to store and process large matrices, and Numpy provides many advanced numerical programming tools such as matrix data types, vector processing, and precision. The computational library is designed for rigorous digital processing.

It is a powerful scientific computing package based on python. To install Numpy you must first install python. The installation of python is very simple, I installed python3.7. The installation steps for installing Numpy for Windows will be the same for Ubuntu and other Linux systems. The only difference will be the installation process of Python

Installing NumPy

You can follow the steps outlined below and use the commands on most Linux, Mac, or Windows systems. Any irregularities in commands are noted along with instructions on how to modify them to your needs.

Step 1: Check Python Version

Before you can install NumPy, you need to know which Python version you have. This programming language comes preinstalled on most operating systems (except Windows; you will need to install Python on Windows manually).

Most likely, you have Python 2 or Python 3 installed, or even both versions.

To check whether you have Python 2, run the command:

  • python -V

The output should give you a version number.

To see if you have Python 3 on your system, enter the following in the terminal window:

  • python3 -V

In the example below, you can see both versions of Python are present.


If these commands do not work on your system, take a look at this article on How To Check Python Version In Linux, Mac, & Windows.

Step 2: Install Pip

The easiest way to install NumPy is by using Pip. Pip a package manager for installing and managing Python software packages.

Unlike Python, Pip does not come preinstalled on most operating systems. Therefore, you need to set up the package manager that corresponds to the version of Python you have. If you have both versions of Python, install both Pip versions as well.

The commands below use the apt utility as we are installing on Ubuntu for the purposes of this article.

Install Pip (for Python 2) by running:

  • sudo apt install python-pip

If you need Pip for Python 3, use the command:

  • sudo apt install python3-pip

Finally, verify you have successfully installed Pip by typing pip -V and/or pip3 -V in the terminal window.


Step 3: Install NumPy

With Pip set up, you can use its command line for installing NumPy.

Install NumPy with Python 2 by typing:

  • pip install numpy

Pip downloads the NumPy package and notifies you it has been successfully installed.

Install-NumPy-Python 2

To install NumPy with the package manager for Python 3, run:

  • pip3 install numpy

As this is a newer version of Python, the Numpy version also differs as you can see in the image below.

Numpy-Install-With-Python 3

Step 4: Verify NumPy Installation

Use the show command to verify whether NumPy is now part of you Python packages:

  • pip show numpy

And for Pip3 type:

  • pip3 show numpy

The output should confirm you have NumPy, which version you are using, as well as where the package is stored.

Step 5: Import the NumPy Package

After installing NumPy you can import the package and set an alias for it.

To do so, move to the python prompt by typing one of the following commands:

  • python
  • python3

Once you are in the python or python3 prompt you can import the new package and add an alias for it (in the example below it is np):

Python Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download
  • import numpy as np
  • Upgrading NumPy

Upgrading NumPyIf you already have NumPy and want to upgrade to the latest version, for Pip2 use the command:

  • pip install –upgrade numpy

If using Pip3, run the following command:

  • pip3 install –upgrade numpy

Are you looking training with Right Jobs?

Contact Us

Popular Courses