Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check Boto3 Version

Tags:

python

How do I check the version of boto3 I am running?

I tried going into REPL and running these commands:

>>> import boto3
>>> boto3.Version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'boto3' has no attribute 'Version'
like image 467
bluethundr Avatar asked Jun 19 '19 13:06

bluethundr


People also ask

Is boto3 part of python3?

Boto3 was built from the ground up with native support for Python 3 in mind. With each build, it is fully tested with Python versions 3.4, 3.3, 2.7, and 2.6.


3 Answers

I know this is late but you can also use:

pip show boto3

like image 122
funkyfunk Avatar answered Nov 15 '22 18:11

funkyfunk


You can always use dir function to know all the properties and methods of object.

dir(boto3)

['DEFAULT_SESSION', 'NullHandler', 'Session', '__author__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_get_default_session', 'client', 'docs', 'exceptions', 'logging', 'resource', 'resources', 'session', 'set_stream_logger', 'setup_default_session', 'utils']

From this output you can see __version__.

boto3.__version__
like image 31
saranjeet singh Avatar answered Nov 15 '22 19:11

saranjeet singh


Try using .__version__ or .version

PEP 8 standard is to use the __version__ attribute for this, however it is worth noting that some modules implement version instead.

like image 37
BHC Avatar answered Nov 15 '22 20:11

BHC