python - curl :(7)无法连接到::1:网络无法访问

当我在终端中键入 curl http://localhost:8000/ 以运行 python/tornado 脚本时出现上述错误。

我的 curl 版本是 7.19.7。我禁用了 IPV6。

我的/etc/hosts 读取

127.0.0.1   localhost
127.0.1.1   aniruddha-laptop

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

lsof | 的输出grep 8000

dbus-daem  1338  aniruddha   67u     unix 0xf2208000      0t0       8923 socket
gconfd-2   1341  aniruddha   20u     unix 0xf2ab8000      0t0       7180 socket
trashappl  1468  aniruddha   18u     unix 0xf4248000      0t0       8689 socket
notificat  1478  aniruddha   14u     unix 0xf20a8000      0t0       8613 socket

最佳答案

执行 cat/etc/resolv.conf 你会找到 nameserver 127.0.0.1,然后你应该移动这个条目并添加任何可用的名称服务器。

关于python - curl :(7)无法连接到::1:网络无法访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11120300/

相关文章:

git - 编译或下载静态版本的 git

html5-video - 嵌入/使用 mediaelement.js 的正确方法

user-interface - IIS Express 图标是什么意思?

php - 使用 youtube api 查找观看次数最少的视频?

python - 如何通过终端获取mac os的语言

google-chrome-extension - 在生产和开发环境中处理 URL

android - scrollview 在 android 中滚动到中间

php - 日志中时间戳的时区?

google-chrome-extension - 当我们在扩展弹出窗口之外单击时自动关闭如何保持打

mysql - 我可以杀死 "repair by keycache"吗?