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

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



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'