_tkinter.TclError: no display name and no $DISPLAY environment variable

Windows下使用putty远程连接到服务器上,需要显示图形界面时比如show()时会出现此error.

1.在服务器端安装xterm和xauth:

yum install xterm

yum install xauth

2.在服务器端vi /etc/ssh/sshd_config,添加一行:

X11Forwarding yes

3.重启sshd

systemctl restart sshd.service  --重启

systemctl status sshd.service   --查看状态

4.在Windows端下载Xming+Putty

5.安装并开启Xming后,打开Putty进行配置:


后面的X display location不用填。

登陆后,运行xterm代表成功。


你可能感兴趣的:(_tkinter.TclError: no display name and no $DISPLAY environment variable)