Finding Python Module version

Sometimes it becomes a need to find out particular module version in Python, here is the quickest way to find it:

  1. Launch python
  2. >>> import <module_by_name>
  3. Try any of the following way to get the module version:
    1. >>> ModuleName.__version__
    2. >>> ModuleName.version
    3. >>> ModuleName.version_string

Here is an example of finding pyCrypto (Module name – Crypto) version:

╚═╝ § python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import Crypto
>>> Crpto.__version__
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
NameError: name ‘Crpto’ is not defined
>>> Crypto.__version__
‘2.6’
>>> quit()

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s