Python Programming (121 Blogs) Become a Certified Professional
AWS Global Infrastructure

Data Science

Topics Covered
  • Business Analytics with R (30 Blogs)
  • Data Science (39 Blogs)
  • Mastering Python (64 Blogs)
  • Decision Tree Modeling Using R (1 Blogs)
SEE MORE

MI-new-launch

myMock Interview Service for Real Tech Jobs

myMock-widget-banner-bg

How To Install NumPy In Python?

Published on Sep 23,2019 118 Views
2 / 17 Blog from Python Libraries

MI-new-launch

myMock Interview Service for Real Tech Jobs

myMock-mobile-banner-bg

myMock Interview Service for Real Tech Jobs

  • Mock interview in latest tech domains i.e JAVA, AI, DEVOPS,etc
  • Get interviewed by leading tech experts
  • Real time assessment report and video recording

NumPy is one library which is very integral to Python Programming. In this article we will learn how to install NumPy in Python. Following pointers will be covered in this article,

Lets begin!

Introduction

Python is open source object oriented interpreted language. Of the many features, one of the important features that makes python a strong programming language is Python packages. A lot of external packages are written in python which you can be installed and used depending upon your requirement.

Python packages are nothing but directory of python scripts. Each script is a module which can be a function, methods or new python type created for particular functionality. numpy is one such important package created to ease array computation in python.

In this blog we will explain the process of downloading and installing numpy packages and how to use them in python environment on mac, windows, ubuntu and fedora operating systems. The basics of python programming language are not covered in this blog. For beginners, the basics of python programming language are covered in this Edureka blog.

All python packages are installed using pip – Package Installer for Python. You can view the details of all python packages and download them from Python Package Index (PyPI). However, pip is automatically installed when you download and install python from python.org or any other python integrated environment. Please read the blog for the best python integrated platforms which also provides loads of other functionalities. pip is the simplest way to download packages directly from PyPI from your command line.

Moving on with this Install NumPy in Python article

NumPy Installation On Mac Operating System

Now let’s install see how to install numpy on a mac operating system. This section details on installing numpy on both python 2.7 and latest version of python 3.7.

PYTHON 2.7

Open a terminal in your MacBook and type python to get into python prompt.
1. Press command (⌘) + Space Bar to open Spotlight search. Type in Terminal and press enter.

Output- Numpy installation - Edureka

Output- Numpy installation - Edureka

 

2. In the terminal, use the pip command to install numpy package.

Output- Numpy installation - Edureka

3. Once the package is installed successfully, type python to get into python prompt. Notice the python version is displayed too. Use the import command to include numpy package and use it. You can also set an alias name (shortcut) for package.

Output- Numpy installation - Edureka

Python 3

Similarly, you can install numpy in python 3 also. After opening the terminal as detailed in step 1 above, use pip3 command to install numpy. Please notice we are using pip3 command instead of pip. pip3 command is used to let our system know that we are working with python3.

Output- Numpy installation - Edureka

Moving on with this Install NumPy in Python article we will see how to install NumPy on Windows Operating System

NumPy Installation On Windows Operating System

Python is not installed by default in windows operating system. You can download the required version of python from python.org. Once python is installed successfully, open command prompt and use pip to install numpy.

Output- Numpy installation - Edureka

Moving on with this Install NumPy in Python article

NumPy Installation On Ubuntu Operating System

Python is installed by default on ubuntu systems. However, pip is not installed. If you want the complete package, download python from python.org and install it on your ubuntu operating system using apt install command.
Alternatively, you can install pip on ubuntu and then install numpy which is the easier of the two ways.
You will need root privileges on the system to install pip and numpy. Open a terminal in ubuntu and install pip and pip3 using apt.

Output- Numpy installation - Edureka

Once pip is installed you can install numpy with same commands to install numpy.

Output- Numpy installation - Edureka

Output- Numpy installation - Edureka

Moving on with this Install NumPy in Python article

NumPy Installation On Fedora Operating System

Similar to Ubuntu operating system python is installed by default in fedora. Use pip command to install numpy.

Output- Numpy installation - Edureka (6)

Notice the difference in pip command for python3 specifically in fedora operating systems. Secondly, be aware that installing numpy with pip, installed it for both Python2 and Python3 automatically. This brings us to the end of this article.

To get in-depth knowledge on Python along with its various applications, you can enroll here for live online training with 24/7 support and lifetime access.

Got a question for us? Mention them in the comments section of  article and we will get back to you.

Comments
0 Comments

Browse Categories

Subscribe to our Newsletter, and get personalized recommendations.