Forums

Tweepy - unable to authentificate

Hi !

I have been using Tweepy on PythonAnywhere for days, and it worked perfectly. But now i have this error message. Can anyone help me please ?

Thank you so much !

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 142, in _new_conn (self.host, self.port), self.timeout, **extra_kw) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/connection.py", line 67, in create_connection for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 578, in urlopen chunked=chunked) self._validate_conn(conn) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 351, in _make_request self._validate_conn(conn) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 814, in _validate_conn conn.connect() File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 254, in connect conn = self._new_conn() File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connection.py", line 151, in _new_conn self, "Failed to establish a new connection: %s" % e) requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6af7c42828>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 403, in send timeout=timeout File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/connectionpool.py", line 623, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/local/lib/python3.5/dist-packages/requests/packages/urllib3/util/retry.py", line 281, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/users/show.json?id=thebenimou (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6af7c42828>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tweepy/binder.py", line 187, in execute proxies=self.api.proxy) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 475, in request resp = self.send(prep, send_kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 585, in send r = adapter.send(request, kwargs) File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 467, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/users/show.json?id=thebenimou (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6af7c42828>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/moibnj/testss.py", line 6, in <module> user = api.get_user("thebenimou") File "/usr/local/lib/python3.5/dist-packages/tweepy/binder.py", line 245, in _call return method.execute() File "/usr/local/lib/python3.5/dist-packages/tweepy/binder.py", line 189, in execute raise TweepError('Failed to send request: %s' % e) tweepy.error.TweepError: Failed to send request: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/users/show.json?id=thebenimou (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6af7c42828>: Fail ed to establish a new connection: [Errno -2] Name or service not known',))

I believe some parts of twitter is also down due to the dns issues in the post below.

Hi, I have to add that my code still works perfectly on my laptop. But it's not working on pythonanywhere anymore.

Hi, I have to add that my code still works perfectly on my laptop. But it's not working on pythonanywhere anymore.

it works again ! thank you