1👍
✅
client.SetServer('127.0.0.1', 5432)
There you are trying to connect to port 5432. But
listen = 9312
listen = 9306:mysql41
suggests you have sphinx listening on port 9312.
You should be using the same port!
Source:stackexchange.com