zoukankan      html  css  js  c++  java
  • 一站式解决Mac--socket.gaierror: [Errno 8] nodename nor servname provided, or not known

    socket.gaierror: [Errno 8] nodename nor servname provided, or not known

    原因:hostname 没有写在/etc/hosts里

    干脆利索,解决方案:

      1.需要将hostname写到hosts文件里,怎么获取hostname

    python   # 进入python环境
    >>>import socket
    >>>socket.gethostname()
    >>>>exit()

      2.修改hosts文件

    vim /etc/hosts
    
    127.0.0.1    hostname   # 将获取到的hostname写进来

      3.Mac系统修改hosts文件有权限限制,本人已成功解决,参考链接

    https://jingyan.baidu.com/article/f3ad7d0f55154309c3345bdd.html
  • 相关阅读:
    删数问题
    装箱问题
    活动选择
    智力大冲浪
    三国游戏
    最大乘积
    排队接水
    线段覆盖
    高精度重载运算符
    数的划分
  • 原文地址:https://www.cnblogs.com/lutt/p/11908226.html
Copyright © 2011-2022 走看看