close

How to check python module version

Hello guys. How are you all? I hope you all fine. In this tutorial we will learn about how to check python module version. so without wasting time lets learn about of this.

How to check python module version

  1. check python module version

    to check python module version just Use pkg.resources(). By using pkg.resources() you can check python module version. It is very easy to use. Lets learn about of this by given below example: import pkg_resources print(pkg_resources.get_distribution('numpy').version) Output : 1.22.0

  2. How to check python module version

    to check python module version just Use _version_(). By using pkg.resources() you can check python module version. It is very easy to use. Lets learn about of this by given below example: import pkg_resources print(pkg_resources.get_distribution('numpy').version) Output : 1.22.0

  3. python check package version

    To check python module version just Use _version_(). By using pkg.resources() you can check python module version. It is very easy to use. Lets learn about of this by given below example: import pkg_resources print(pkg_resources.get_distribution('numpy').version) Output : 1.22.0

Method 1: Use pkg.resources()

By using pkg.resources() you can check module version. It is very easy to use. Lets learn about of this by given below example:

import pkg_resources
print(pkg_resources.get_distribution('numpy').version)

Output :

1.22.0

Method 2: Use _version_()

By using _version_() you can check module version. It is very easy to use. Lets learn about of this by given below example:

import numpy
print(numpy.__version__)

Output :

1.22.0

Conclusion

It’s all About this Tutorial. Hope all methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you?

Also, Read

Leave a Comment