Python Forum
getting ImportError: cannot import name 'HAProxyServer' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: getting ImportError: cannot import name 'HAProxyServer' (/thread-22419.html)



getting ImportError: cannot import name 'HAProxyServer' - deepakkr3110 - Nov-12-2019

#!/usr/bin/python3.6

from haproxystats import HAProxyServer

class HAProxyServer:
    haproxy=HAProxyServer('x.x.x.x:x222')
    for b in haproxy.backends:
        print('%s: %s' % (b.name, b.status))
if i run the above code i am getting error

python3.6 hatop.py

File "hatop.py", line 3, in <module>
from haproxystats import HAProxyServer
ImportError: cannot import name 'HAProxyServer'