Saturday, November 16, 2024
Google search engine
HomeLanguagesHow to install NumPy in PyCharm?

How to install NumPy in PyCharm?

In this article, we will cover how to install the Python NumPy package in PyCharm. NumPy is a general-purpose array-processing Python package. It provides a high-performance multidimensional array object, and tools for working with these arrays. As one of the most important tool while working with data manipulation, we often need to install NumPy package. It’s a third party module, i.e. we need to install it separately. There can be multiple ways of installing NumPy package. While using PyCharm the easiest way to install is using PyCharm User interface, by following the steps as discussed below:

Install NumPy in PyCharm Using GUI:

Step 1: Click on file and then go to the settings.

How to install NumPy in PyCharm?

PyCharm Menu bar

For Settings, you can either click on file and then click the settings option, or you can also press Ctrl+Alt+S.

PyCharm File Menu

File > Settings

Step 2: Under Settings, choose Python project and select Python Interpreter.

How to install NumPy in PyCharm?

File > Settings > Project

Step 3: Now after clicking on Python Interpreter:

Select interpreter in PyCharm

File > Settings > Project > Project Interpreter

Step 4: Now, there is a + sign on the screen. Click it and in the search bar search for NumPy module and then install the package.

Select numpy in pycharm

Search for Numpy package

Step 5: Click on NumPy option which is shown above and then click Install Package.

How to install NumPy in PyCharm?

Package installation menu in PyCharm

NumPy package installed successfully.

How to install NumPy in PyCharm?

numpy got installed successfully

If You Are Unable To Install And Got An Error

If you are facing errors while trying to install NumPy using PyCharm GUI, then you can try installing NumPy directly from the PyCharm terminal.

error while installing numpy in PyCharm

Error message in case NumPy installation has failed

Install NumPy from PyCharm Terminal

To open terminal, you can check the bottom of the PyCharm window for the terminal tab, or press Alt + F12 to open the terminal window.

Pycharm terminal tab

Open terminal tab from PyCharm UI

After the terminal tab is opened, type the following commands to install NumPy in the current Python environment.

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

How to test if NumPy is installed or not?

After the installation of the NumPy on the Python environment, we can easily check whether NumPy is installed or not. To do so, we have to use the following command to check. Inside the PyCharm write the following code and run the program for getting the output.

Python3




import numpy as np
  
print(np.__version__)


Output:

1.23.1
RELATED ARTICLES

Most Popular

Recent Comments