Forums

Tweepy: failed to send request (Connection refused)

I've been using tweepy for a while on this website with no problems at all, however, about a week ago I started experiencing this error: Failed to send request: [Errno 111] Connection refused

There is very little info online about it, but I suspect the problem is with proxy settings. Any help on this topic would be much appreciated. Thanks!

You're right, it's almost certainly proxy settings. About a week ago we had to block unproxied internet access for non-paying users after a couple of nasty incidents with people using our site as a staging post for launching attacks on other servers on the net. The proxy settings are put into your scripts' environment automatically, but perhaps tweepy isn't looking at them. If there's a manual way to tell it to use a proxy, the server is "proxy.server" and the port is 3128.

One caveat -- the Python "requests" and "urllib3" libraries have a bug that stops them from correctly connecting via https via a proxy -- they're working on fixing it, and we'll update our installed version as soon as they have. But if tweepy uses them to connect, then it won't work until then.

Unfortunately there are no ways to manually set proxy settings with tweepy, so I'll wait for the fix. Thanks for the fast reply!

At least when it does get fixed you'll be able to Tweet everyone about your success...:)

i seem to have the exact same problem.

As the issue been solved since then ? How can I workaround it ? In the meantime, I'll try the proxy stuff :)

Thx :)

Over the weekend, I discovered a fork of tweepy the honours the proxy settings. I don't know whether it works, because I haven't tried it, but the changes suggest that it should work fine. It's on github. There's also some discussion on stackoverflow that might shed some light.

I am having the same problem - am I correct in understanding that upgrading from my free account should solve this?

Yes. It will.

well you just made yourself five dollars, glenn. thanks