How To Install NumPy in Windows 11 (PyCharm/VSCode)

NumPy is an important library available for scientific computing and mathematical purposes in Python. Learn how easy it is to install NumPy on Windows 11 with PIP and Command Prompt (CMD) and install it on macOS and other Linux distributions.

NumPy is a 100% open-source project which comes for free! It includes the following:

  1. Different derived objects like masked arrays and matrices.
  2. Assortment of routines or fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting and Input/Output operations.

Why it is used the most and why it is so popular?

  • It provides an array of objects 5x faster than the traditional lists.
  • Ndarray, one of the array objects in this, provides you with many supporting functions, making working with it easy.
  • Arrays are often used in data science in which speed and resources are quite important.

The 2 reasons behind its Popularity:

  1. Compact, powerful and expressive syntax.
  2. You can manage your data in vectors, matrices and higher dimensional arrays.

History of NumPy

Jim Hugunin with contributions to many other developers created the ancestor of NumPy known as Numeric. After this, in 2005 Travis Oliphant created this by incorporating many features of competing Numarray into Numeric. After All these modifications made, we got this project, which is open-source and has plenty of contributors

It is written in Python, but many parts that require fast computations are written down in C/ C++.

Pros and Cons of Installing and Using NumPy

  1. Takes less space on your hard drive.
  2. Provide good runtime when compared with others.
  3. It created n-dimension arrays.
  4. It is best for data analysis and scientific uses.
  5. A great substitute for MATLAB, is OCTAVE as it provides the same functions.
  6. It provides support to vectorized operations such as elementwise addition and multiplication, computing Kronecker products, and much more.
  7. It supports linear algebra.

Only 2 cons:

  1. Needs contiguous allocation of memory.
  2. Using nan in NumPy: it stands for “not a number”.

ALSO SEE: A tutorial on Installing PyCharm on Windows 11.

How to Install NumPy on Windows 11 via PIP, CMD and POP3 (3 Easy Steps)

Before you continue the below, make sure Python is already downloaded and installed. if not follow our guide on how to install Python 3.

If you do not know then by default windows do not have Python. Therefore, you need to download the version required from python.org. Once done, you can easily open the command prompt and install pip.

Paul@ninja-ide:~# Pop3 install numpy

Paul@ninja-ide:~#  Successfully installed numpy-1.x.x

Paul@ninja-ide:~#  >>> import numpy as np

To Install via PIP:

Paul@ninja-ide:~# Pip install numpy

How to Install NumPy on Apple macOS & Linux

To Install NumPy v2.7:

  • In your Macbook open the terminal and type python to get into the python prompt.
  • After this to open the spotlight search press the command (⌘) +  space bar. Type in the terminal and hit “enter”.
  • Here, use the pip command to get the NumPy package.
Paul@ninja-ide:~# Pip install numpy
  • As it gets installed you need to type in Python to have its prompt, you shall see that version is also mentioned. All you need to do is use the import command to include the NumPy package and then use it. A shortcut can also be set for it.

To Install NumPy Version 3:

When you open the terminal as mentioned above in step 1, use the “pip3” command” to install it.

Have a note on that command being used Pip3 means we are working with version 3 of Python. Just keep it in your mind.

Paul@ninja-ide:~# Pip3 install numpy
Paul@ninja-ide:~# Import numpy as ny

The above method has been verified to work on Apple M1 and M2 chip laptops.

Installing on Fedora and Ubuntu

You shall find Python on this by default. All you have to do is use the pip command to install

Paul@ninja-ide:~# Pip install numpy
Paul@ninja-ide:~# Pytho3 –m pip install numpy

On Ubuntu, by default, you shall find Python but the sad part pip is not installed. For a complete package visit python.org and install it by using the apt install command.

Now, as an alternate, you can also install it and then install NumPy which is the easiest of the two ways, I didn’t understand. Let us explain

On the system, you must have root privileges for this to work.

For this:

  1. In Ubuntu, you need to open a terminal.
  2. Then install pip and pip3 by using apt.
Paul@ninja-ide:~#  Apt install python-pip python-pip3y

Conclusion

NumPy is the most popular free mathematical library for Python! After following the above tutorial on installing NumPy on Windows 11, Mac and other Linux distros should be a breeze. The methods we have shared for the installation are performed using PIP, POP3 and Apt which are the most common ways and reliably work as expected.

Previous articleCreate a Python Keylogger with Send Email Capability (Download Source Code)
Next article16 PyCharm Keyboard Shortcuts for Windows and Mac (2024 PDF)
Paul Carruthers
Paul is an avid programmer who specializes in Python and Java with over 16 years of experience in the field. He loves automating complex tasks and creating useful scripts to streamline work and make life easier. He is also a massive fan of Linux and currently uses it as his main desktop OS. When he is not staring at code, he loves hiking and swimming in different parts of the world.

LEAVE A REPLY

Please enter your comment!
Please enter your name here