Python Forum

Full Version: getting ImportError: cannot import name 'HAProxyServer'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
#!/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'