Example 1: Python Code:
import numpy as np
print(np.__version__)
Sample Output:
1.12.0
Update: for python3 use print(numpy.__version__)
Example 2: checks which version of NumPy I’m using
import numpy
numpy.version.version
Example 3: How to detect if numpy is installed?
try:
import numpy
except ImportError:
print "Sorry, numpy is not installed"
I hope you get an idea about pip install numpy.