Numpy is a very popular library for easily creating single, multidimensional arrays and matrices. It has a large collection of mathematical functions for performing an operation on these arrays. Most of the new Programmers are unable to install NumPy properly and they get no module named numpy found error. In this tutorial on How to, you will know how to install numpy in Pycharm. Just follow the simple steps to install it on Pycharm.
When you write import numpy as np , then you will see the text without any highlighting or you will see red undeline on the word numpy just like below. It means Pycharm has not recognized it. You will get an import error when you try to run the code.
Steps to Install Numpy in Pycharm
Step1: Go to the File and click on Settings.
Step 2: You will see > Project: your_project_name.Click on it. You will see two option one is Project Interpreter and other Project Structure.
Step 3: Click on the Project Interpreter. You will see all the packages installed.
Step 4: You will see the + button. Click on it and search for the numpy in the search field. You will see the numpy package as the left side and its description, version on the right side. Be sure to check the author and URL of the package(numpy.org) before selecting and installing the package.
Step 5: Selecting numpy click on the Install Package on the left bottom. It will install the packages. If you are unable to install and got an error. Then go to terminal first upgrade pip using the command.
python -m pip install --upgrade pip
Then use the following command to install the numpy.
pip install numpy
Congrats you have successful install the numpy in Pycharm.
How to test if numpy is installed or not?
After the installation of the numpy on the system you can easily check whether numpy is installed or not. To do so, just use the following command to check. Inside the Pycharm write the following code and run the program for getting the output.
import numpy as np print (np.__version__)
When you will run it you see the following output that is numpy version.
How to Install Numpy on Linux Operating System?
The above steps are for installing NumPy in Pycharm and in Windows. In this section you will know how to install NumPy on Linux Operating System. Just follow the steps to install it.
Step 1: Install the Python Pip Module.
Make sure you have already installed the Python Module. Go to the terminal and type the following commands on it.
sudo apt update sudo apt install python-pip python3-pip # python-pip for 2.xx version and python3-pip for 3.xx version
Step 2: Install the NumPy
If you are able to successfully installed the pip in your system then run the following command to install the NumPy.
For Python 2.xx version
pip install numpy
For Python 3.xx version
pip3 install numpy
In this case I am installing for the python 3.xx version. Following these steps, You have successfully installed the Numpy Library on Linux.
How to Uninstall Numpy from Pycharm?
Some readers have asked us If I have installed NumPy and want to uninstall it from Pycharm in the future How to do it? In this section, you will know how to uninstall Numpy from Pycharm through steps by steps.
Step 1: Go to File>>Setting and click on your Project: Your Project Name.
Step 2: Click on Project Interpreter. There you will see all the packages installed in it.
Step 3: Select the Numpy package and click on the “-“ icon. It will successfully remove the Numpy package from your Pycharm.
You will see the message in the green background color saying “Package Numpy successfully uninstalled“. Press Ok to Continue.
No Module Named Numpy Import Error
This type of error comes when you have not properly installed NumPy in your system or the previous version of the numpy is conflicting with the new version. To solve this issue you have to uninstall the previous version and install it using the pip command.
pip uninstall numpy
pip install numpy
We have created a dedicated article on this error you can find the detailed solution to this import error.
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.