user3831290 user3831290 - 1 year ago 127
Python Question

Getting errors in connecting with AWS when using from windows 7

I am trying to connect with DynamoDb from my laptop which has operating system windows7. But i get following error when i run the simple python script for creating a table in dynamodb. What i got from error is that it is some connectivity issue. Snapshot is attached showing the errors, if anyone has idea then please share.

File "/home/name/.local/lib/python2.7/site-packages/boto3/resources/", line 520, in do_action
response = action(self, *args, **kwargs)
File "/home/name/.local/lib/python2.7/site-packages/boto3/resources/", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(**params)

File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 159, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 483, in _make_api_call
operation_model, request_dict)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 141, in make_request
return self._send_request(request_dict, operation_model)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 170, in _send_request
success_response, exception):
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 249, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 227, in emit
return self._emit(event_name, kwargs)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 210, in _emit
response = handler(**kwargs)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 251, in __call__
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 317, in __call__
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 223, in __call__
attempt_number, caught_exception)
File "/home/name/.local/lib/python2.7/site-packages/botocore/", line 359, in _check_caught_exception
raise caught_exception
botocore.vendored.requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))

Python Code

import boto3

# Get the service resource.
dynamodb = boto3.resource('dynamodb')

# Create the DynamoDB table.
table = dynamodb.create_table(
'AttributeName': 'username',
'KeyType': 'HASH'
'AttributeName': 'last_name',
'KeyType': 'RANGE'
'AttributeName': 'username',
'AttributeType': 'S'
'AttributeName': 'last_name',
'AttributeType': 'S'

'ReadCapacityUnits': 5,
'WriteCapacityUnits': 5

# Wait until the table exists.

# Print out some data about the table.


Answer Source

Problem is solved. I have added the http and https proxy in environment variable.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download