SSH越しにアプリをつくっていた時のこと。
クライアントを接続したまま半日放置し、帰宅後に同じコマンドを叩いたら以下のようなエラーが。
$ python3 tkintertest.py
Traceback (most recent call last):
File "tkintertest.py", line 24, in <module>
root = tk.Tk()
File "/home/encrobot/anaconda3/lib/python3.7/tkinter/__init__.py", line 2023, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display "localhost:10.0"これ、"SSH -X"コマンドを繋ぎっぱなしだったのが問題だったらしく
コマンドから一度ぬけて、新しく接続しなおしたら動きました。