【报错篇】_tkinter.TclError: couldn‘t connect to display “yue:10.0“问题解决

1.问题描述

_tkinter.TclError: couldn't connect to display "localhost:10.0"

2.解决方法

如果是在docker里报的此错误就在docker里执行。

  • step1:查看ipconfig
    回到windows桌面,win+R —> cmd —> ipconfig,记录ip。
    在这里插入图片描述
  • step2:查看ipconfig
    回到linux下,执行如下代码:vi /etc/hosts,修改为如下的形式。source /etc/hosts即可。
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42326479/article/details/124826242