Home > Article > Backend Development > Why Does My Bottle Hello World Sample Fail with \"getaddrinfo failed\"?
Understanding "getaddrinfo failed" Error when Launching Bottle Hello World Sample
When trying to run the hello world sample from the BottlePy documentation, users may encounter the "getaddrinfo failed" error. This error occurs when the getaddrinfo function, used for resolving hostnames to IP addresses, fails.
The most common cause of this error is an unresolved hostname. To determine if this is the case, try running the following Python code:
If the code returns an error, it indicates that the localhost hostname cannot be resolved.
To resolve this issue, try using the IP address '127.0.0.1' instead of 'localhost' in the Bottle sample. This should work if the hostname is the only problem causing the "getaddrinfo failed" error.
The above is the detailed content of Why Does My Bottle Hello World Sample Fail with \"getaddrinfo failed\"?. For more information, please follow other related articles on the PHP Chinese website!