Check NumPy version: np.version

Posted: 2019-09-20 / Tags: Python, NumPy

There are following ways to check the version of NumPy used in the script.

  • Get version number: __version__ attribute
  • Get detailed information such as Git revision: np.version

See the following post for how to check the installed NumPy version with pip command.

Sponsored Link

Get version number: __version__ attribute

Like many other packages, you can get the version number of NumPy with the __version__ attribute.

import numpy as np

# 1.14.1

Get detailed information such as Git revision: np.version file is generated from when NumPy is installed, you can get the following values.

# 1.14.1

# 1.14.1

# 1.14.1

# 7dcee7a469ad1bbfef1cd8980dc18bf5869c5391

# True

In the above example, version, short_version, and full_version all have the same value, but if it is not the release version, git_revision is added to version and full_version.

See the link below for the source.

Sponsored Link

Related Categories

Related Posts