方法一:python 命令行下运行  vi /etc/hosts

将127.0.1.1 那一行的名字改成你的(用 vi /etc/hostname 获取)

127.0.0.1 localhost

127.0.1.1 your hostname  #此处的填hostname,记住必须与/etc/hostname中的名字一致!

以上更改后退出vim 保存更改  如果提示文件为只读状态导致无法更改  那就先去获取超级管理员权限(sudo -s     输入自己的密码进入),然后再去进行以上操作即可

这种方法可以有效的防止OSError: [Errno 99] Cannot assign requested address错误的发生

 

来自:https://blog.csdn.net/weixin_40612082/article/details/80032613

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2022-01-04
  • 2021-11-26
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-05-19
相关资源
相似解决方案