title: boto3 error: object has no attribute
body: <p>Got error when executing the simple code</p>
  
  <pre><code>#!/usr/bin/pyhon
  
  import boto3
  
  ec2 = boto3.resource('ec2')
  res = ec2.describe_instances()
  </code></pre>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "ec2.py", line 6, in 
      res = ec2.describe_instances()
      AttributeError: 'ec2.ServiceResource' object has no attribute 'describe_instances'</p>
  </blockquote>
  
  <p>Can anyone explain the exact cause of the same error. How can I get all the methods described in the following link to work</p>
  
  <p><a href="https://botocore.readthedocs.io/en/latest/reference/services/ec2.html" rel="nofollow noreferrer">https://botocore.readthedocs.io/en/latest/reference/services/ec2.html</a></p>
  
  <p>Below is the aws version installed in my test enviormnet</p>
  
  <blockquote>
    <p>aws --version
    aws-cli/1.11.83 Python/2.7.9 Linux/3.19.0-79-generic botocore/1.5.46</p>
  </blockquote>