My code is as follows
from twilio.rest import TwilioRestClient #programmable text service module
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(
to="*****",
from_="+*****",
body="text",
) #sending actual message
For obvious reasons I have removed the phone numbers as well as the Account_SID and AUTH_TOKEN variables, but rest assured all of that is in my code. The error I recieve is ConnectionRefusedError: [Errno 111] Connection refused. And my entire traceback is shown below. I can't seem to find a solution; the code runs fine locally, but throws this error on PA. I'm also very new to this site so I apologize if I'm missing something.
The traceback
Traceback (most recent call last):
File "/home/ectobiologist7/day_counter_summer.py", line 44, in <module>
carp()
File "/home/ectobiologist7/day_counter_summer.py", line 25, in carp
megusta()
File "/home/ectobiologist7/day_counter_summer.py", line 40, in megusta
body="text",
File "/usr/local/lib/python3.3/dist-packages/twilio/rest/resources/messages.py", line 122, in create
return self.create_instance(kwargs)
File "/usr/local/lib/python3.3/dist-packages/twilio/rest/resources/base.py", line 341, in create_instance
data=transform_params(body))
File "/usr/local/lib/python3.3/dist-packages/twilio/rest/resources/base.py", line 193, in request
resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
File "/usr/local/lib/python3.3/dist-packages/twilio/rest/resources/base.py", line 148, in make_twilio_request
resp = make_request(method, uri, **kwargs)
File "/usr/local/lib/python3.3/dist-packages/twilio/rest/resources/base.py", line 115, in make_request
resp, content = http.request(url, method, headers=headers, body=data)
File "/usr/local/lib/python3.3/dist-packages/httplib2/__init__.py", line 1272, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python3.3/dist-packages/httplib2/__init__.py", line 1026, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python3.3/dist-packages/httplib2/__init__.py", line 963, in _conn_request
conn.connect()
File "/usr/lib/python3.3/http/client.py", line 1198, in connect
self.timeout, self.source_address)
File "/usr/lib/python3.3/socket.py", line 435, in create_connection
raise err
File "/usr/lib/python3.3/socket.py", line 426, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Thanks in advance for helping!