Different Ways of Installing Python's Numpy on Linux - GeeksforGeeks

08 Oct, 2021
Numpy is a python library that is very popular in the field of data science because it makes the task of data processing very efficient, unlike conventional arrays. If you want to learn more about Numpy, please refer to this article.
Before we start with the installation steps, we have to make sure that your system has python installed.
Type the following command in the terminal   (To open the terminal, press Ctrl + Alt + T)
$ python --version
If the output of the command is a valid python version, then you have python installed in your system.
Example Output:
Python 3.8.10
But if you don’t have Python installed in your system, there’s nothing to worry about. You can install Python using the following commands.
$ sudo apt-get update
$ sudo apt-get install python3
Now that you have successfully installed python in your system, we can start installing Numpy
Follow the below steps to install Numpy on Linux:
Open a new terminal
Enter the following command in your terminal
$ pip install numpy
After the installation is complete, you can test if it was correctly installed using the following commands.
$ pip show numpy
There is an alternate way of checking
$ python

>>> import numpy as np
>>> np.__version__
Example Output:-
'1.17.4'
Follow the below steps to install Numpy using anaconda-Navigator:
Open a new terminal window and enter the command given below
$ anaconda-navigator
Anaconda Navigator
After the Anaconda-Navigator is finished loading click on the Environments tab
Now we will create a virtual environment to install Numpy but if you don’t want to do that you can just install Numpy in your base(root) environment by skipping the steps of creating a virtual environment
Click on the “Create” button at the bottom of the navigator
Now choose a name for your virtual environment and a Python version then click on “Create”
Select your virtual environment and search for “Numpy” in the search bar
Click on Apply
Again click on apply and wait for the completion of the installation process
Now we will check if the installation was successful or not
Click on the PLay button next to the name of your virtual environment and choose “Open Terminal”
In the terminal type the following command:
$ pip show numpy
If your output is similar to this your installation was successful
Follow the below steps to install Numpy on Linux using conda:
Open a new terminal window and enter the command given below
$ conda activate base
Now type the following command to install  Numpy
$ conda install numpy
Press the enter key to continue the installation
After the installation is completed you can verify the installation using the following command
$ pip show numpy
You can install other libraries through Anaconda using the same process.
Congratulations, at this point you have completed the installation process successfully.
kapoorsagar226
how-to-install
Picked
How To
Installation Guide
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install FFmpeg on Windows?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Set Git Username and Password in GitBash?
How to Install Jupyter Notebook on MacOS?
How to create a nested RecyclerView in Android
Installation of Node.js on Linux
How to Install FFmpeg on Windows?
How to Install Pygame on Windows ?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?