gensim.utils.get_my_ip()

gensim.utils.get_my_ip()[source]

Try to obtain our external ip (from the pyro nameserver’s point of view)

This tries to sidestep the issue of bogus /etc/hosts entries and other local misconfigurations, which often mess up hostname resolution.

If all else fails, fall back to simple socket.gethostbyname() lookup.