I have this error when run my python file: _tkinter.TclError: couldn't connect to display "127.0.0.1:0.0"
.
I mention that I am running VSCODE in WSL2 distro and Windows Pylance installed along with tkinter
last version.
In my ZSH terminal I have added this line as it is recommended by Microsoft for WSL2: export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
. Commands like export DISPLAY=:0
doesn't work at all on WSL2.
Many thanks for any help, vhij
LE: I have Windows 11 with Ubuntu 20.04 LTS distro, Xming and VcXsrv.