How to Install NumPy on MacOS | Easy NumPy Installation
Last Updated :
02 Feb, 2024
In this article, we will learn how to install NumPy on MacOS. NumPy is a library for the Python programming language, that adds support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
NumPy Installation in MAC
Python's NumPy library can be installed on Mac using the pip installer and using the setup.py file.
We have explained the 2 methods with easy-to-follow steps. We will also look at how to verify the clean installation of NumPy.
Method 1: Using pip to install the NumPy Package
Follow the below steps to install the Numpy package on macOS using pip:
Step 1: Install the latest Python3 in MacOS
Install latest Python version
Step 2: Check if pip3 and python3 are correctly installed.
python3 --version
pip3 --version

Step 3: Upgrade your pip to avoid errors during installation.
pip3 install --upgrade pip

Step 4: Enter the following command to install Numpy  using pip3.
pip3 install numpy

Method 2: Using setup.py to install NumpyÂ
Follow the below steps to install the Numpy package on macOS using the setup.py file:
Step 1: Download the latest source package of Numpy for python3 from here.
curl https://files.pythonhosted.org/packages/3a/be/650f9c091ef71cb01d735775d554e068752d3ff63d7943b26316dc401749/numpy-1.21.2.zip > numpy.tar.gz

Step 2: Extract the downloaded package using the following command.
tar -xzvf numpy.tar.gz

Step 3: Go inside the folder and Enter the following command to install the package.
Note: You must have developer tools for XCode MacOS installed in your system
cd numpy-1.21.2
python3 setup.py install

Verifying Numpy installation on macOS:
Try NumPy import in your python terminal to verify if the installation has been done properly:
import numpy

If there is any error while importing the module then is not installed properly.
Similar Reads
How to Install Eli5 in Python on MacOS? Eli5 is an open-source library that is written purely in Python for easy and quick debugging of machine learning classifiers and interpreting their predictions. It provides support for machine learning frameworks and packages such as sci-kit-learn, Keras, xgboost, etc. The Eli5 library is a cross-pl
2 min read
How to Install Kaleido in Python on MacOS? Kaleido is a cross-platform Python library for providing useful functions for generating static images such as jpg, png, SVG, and even pdf for web-based visualization libraries like Plotly. It provides a low-level Python API specially designed for use with high-level plotting libraries such as Plotl
2 min read
How to Install PyQt for Python in MacOS? Qt is a collection of cross-platform C++ libraries that provide high-level APIs for interacting with a wide range of modern desktop and mobile platforms. Location and positioning services, multimedia, NFC and Bluetooth connectivity, a Chromium-based web browser, and traditional user interface develo
2 min read
How to Install Pyglet in Python on MacOS? In this article, we will learn how to install Pyglet in Python on MacOS. Pyglet is a cross-platform windowing and multimedia library for Python, intended for developing games and other visually rich applications. Installation:Method 1: Using pip to install Pyglet Follow the below steps to install th
2 min read
How to Install Numpy on Linux? Python NumPy is a general-purpose array processing package that provides tools for handling n-dimensional arrays. It provides various computing tools such as comprehensive mathematical functions, linear algebra routines. NumPy provides both the flexibility of Python and the speed of well-optimized c
2 min read