Python 报错 Temporary failure in name resolution

在学习python的网络编程时:

       socket.gaierror: [Errno -3] Temporary failure in name resolution
<!-- more -->

后来发现是DNS解析出了问题,

解决方法:

在”/etc/hosts”中,加上自己的本机与IP的映射

保存退出

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×