Data Science Certification Training with Pyth ...
- 86k Enrolled Learners
- Live Class
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,
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.
Now let’s see how we can install numpy on a mac operating system. This section details on both python 2.7 and latest version of python 3.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.
2. In the terminal, use the pip command to install numpy package.
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.
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.
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.
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.
Once pip is setup you can use the same commands
Similar to Ubuntu operating system python is installed by default in fedora. Use pip command to install
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.