“getaddrinfo 失败”,这是什么意思?
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args) gaierror: [Errno 11004]
getaddrinfo failed
从 Bottle 文档 启动“Hello World”示例时出现此错误
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这很可能意味着无法解析主机名。
如果它在那里不起作用,那么它在 Bottle 示例中也不会起作用。如果出现问题,您可以尝试使用“127.0.0.1”而不是“localhost”。
It most likely means the hostname can't be resolved.
If it doesn't work there, it's not going to work in the Bottle example. You can try '127.0.0.1' instead of 'localhost' in case that's the problem.
就我而言,问题在于,当我没有代理时,某些安装在某些时候在我的计算机上定义了一个环境变量 http_proxy 。
删除 http_proxy 环境变量解决了问题。
The problem, in my case, was that some install at some point defined an environment variable http_proxy on my machine when I had no proxy.
Removing the http_proxy environment variable fixed the problem.
我的问题是,我需要为
http_proxy
和https_proxy
添加环境变量。例如,
要在 Windows 中设置这些环境变量,请参阅此问题的答案。
The problem in my case was that I needed to add environment variables for
http_proxy
andhttps_proxy
.E.g.,
To set these environment variables in Windows, see the answers to this question.
我花了一些时间来解决这个问题,但结果证明解决方案非常简单。我的 ftp 服务器地址以 ftp:// 开头。我删除了它,代码开始工作。
之前的FTP地址:
修改为:
I spent some good hours fixing this but the solution turned out to be really simple. I had my ftp server address starting with
ftp://
. I removed it and the code started working.FTP address before:
Changed it to:
确保在命令中传递代理属性
例如 - pip install --proxy=http://proxyhost:proxyport pixiedust
使用具有直接连接的代理端口(通过 /无密码)。与您的公司 IT 管理员联系。快速的方法是找出 Eclipse 中使用的网络设置,它将有直接连接。
如果您在公司防火墙后面工作,您会经常遇到此问题。您必须检查您的 Internet Explorer - InternetOptions -LAN Connection - Settings
取消选中 - 使用自动配置脚本
检查 - 为您的 LAN 使用代理服务器。确保您提供了正确的地址和端口。
单击“确定”
回到anaconda终端,你可以尝试安装命令
Make sure you pass a proxy attribute in your command
forexample - pip install --proxy=http://proxyhost:proxyport pixiedust
Use a proxy port which has direct connection (with / without password). Speak with your corporate IT administrator. Quick way is find out network settings used in eclipse which will have direct connection.
You will encouter this issue often if you work behind a corporate firewall. You will have to check your internet explorer - InternetOptions -LAN Connection - Settings
Uncheck - Use automatic configuration script
Check - Use a proxy server for your LAN. Ensure you have given the right address and port.
Click Ok
Come back to anaconda terminal and you can try install commands
也许这会对某人有所帮助。我在 python 脚本中设置了代理,但不断收到问题中提到的错误。
下面是一个块,它将在开始时将我的用户名和密码作为常量。
如果您使用的是公司笔记本电脑并且没有连接到 Direct Access 或办公室 VPN,则上述块将引发错误。您所需要做的就是连接到您的组织 VPN,然后执行您的 python 脚本。
谢谢
May be this will help some one. I have my proxy setup in python script but keep getting the error mentioned in the question.
Below is the piece of block which will take my username and password as a constant in the beginning.
If you are using corporate laptop and if you did not connect to Direct Access or office VPN then the above block will throw error. All you need to do is to connect to your org VPN and then execute your python script.
Thanks