Check NumPy version: np.version
There are following ways to check the version of NumPy used in the script.
- Get version number:
- Get detailed information such as Git revision:
See the following post for how to check the installed NumPy version with
Get version number:
Like many other packages, you can get the version number of NumPy with the
import numpy as np print(np.__version__) # 1.14.1
Get detailed information such as Git revision:
version.py file is generated from
setup.py when NumPy is installed, you can get the following values.
print(np.version.version) # 1.14.1 print(np.version.short_version) # 1.14.1 print(np.version.full_version) # 1.14.1 print(np.version.git_revision) # 7dcee7a469ad1bbfef1cd8980dc18bf5869c5391 print(np.version.release) # True
In the above example,
full_version all have the same value, but if it is not the release version,
git_revision is added to
See the link below for the source.