The easiest way to check a numpy version on Mac, Linux, and Windows platforms is to use the “numpy.__version__” code and run the Python file. It returns the current version of numpy installed on your machine.
If you want to explore multiple solutions, then here are three main ways to check the numpy version:
- Using Python interpreter
- Using Python script
- Using pip or pip3 package manager
Method 1: Using Python interpreter
-
Open Terminal or Command Prompt:
- On Mac and Linux, open the Terminal.
- On Windows, open Command Prompt or PowerShell.
- Launch Python:
- Type python or python3 (depending on your Python installation) and press Enter.
-
Check NumPy Version:
Method 2: Using a Python Script
- Create a Python Script:
Method 3: Using Python’s pip (Package Manager)
You can also use Python’s package manager pip to check the installed NumPy version:
- Open Terminal (Mac/Linux) or Command Prompt (Windows).
- Type pip show numpy or pip3 show numpy and press Enter. This will display detailed information about the NumPy package, including its version.