autoturk
autoturk copied to clipboard
Connection not established in generate.py
I followed all the instructions correctly. I am facing an issue with establishing the connection with MTurk. I get the following error:
Traceback (most recent call last):
File "/home/husain/Work/Code/Computer Vision/aws-mc-turk/generate.py", line 17, in <module>
account_balance = mtc.get_account_balance()[0]
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/mturk/connection.py", line 74, in get_account_balance
('OnHoldBalance', Price)])
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/mturk/connection.py", line 837, in _process_request
response = self.make_request(None, params, verb='POST')
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/connection.py", line 1116, in make_request
return self._mexe(http_request)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/connection.py", line 1030, in _mexe
raise ex
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/connection.py", line 943, in _mexe
request.body, request.headers)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/site-packages/boto/https_connection.py", line 119, in connect
sock = socket.create_connection((self.host, self.port), self.timeout)
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/socket.py", line 704, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/home/husain/anaconda3/envs/aws_mcturk/lib/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
Process finished with exit code 1
I added a line after mtc to show my account balance in order to debug the code. But it shows the error. Please help me fix this issue.