Category: Amazon Web Servicesboto3-python-3-6-error
Eric Post asked 2 months ago
Hello, I\\\’m taking the, \\\”Manage AWS Using Python\\\” course and running into issues with Python 3.6.  When I run the following code on a Python 3.6 machine: ________________________________________________________ import boto3ec2 = boto3.resource(\\\’ec2\\\’, region_name=\\\’us-east-1\\\’)instances = ec2.instances.filter( Filters=[{\\\’Name\\\’: \\\’instance-state-name\\\’, \\\’Values\\\’: [\\\’running\\\’]}])for instance in instances: print(, instance.instance_type) ________________________________________________________ I receive the following error: ________________________________________________________ Traceback (most recent call last):   File \\\”\\\”, line 6, in <module>     Filters=[{\\\’Name\\\’: \\\’instance-state-name\\\’, \\\’Values\\\’: [\\\’running\\\’]}])   File \\\”/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/boto3/resources/\\\”, line 465, in filter     return base_class.filter(self, **kwargs) TypeError: filter() got an unexpected keyword argument \\\’Filters\\\’ ________________________________________________________ However, when I run the same exact code on a machine running Python 3.5, the code runs just fine.  What do I need to run on the 3.6 machine (my main laptop) in order to get the code to run correctly.  Thanks for you help!