且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python - socket.error:无法分配请求的地址

更新时间:2022-11-06 22:31:59

通过检查 errno.h,errno 99 是 EADDRNOTAVAIL.手册页 bind(2) 说:

By checking errno.h, errno 99 is EADDRNOTAVAIL. The man page bind(2) says:

EADDRNOTAVAIL 请求的接口不存在或请求的地址不是本地的.

EADDRNOTAVAIL A nonexistent interface was requested or the requested address was not local.

这通常是由错误的 IP 地址引起的.你可以使用命令ifconfig 检查你的机器是否有这个 IP 地址.

It is often caused by a wrong IP address. You can use the command ifconfig to check whether your machine has this IP address.