This is an error that is common on machines that are running a Linux OS, notably if you have had a break from developer work.
While my machine is running Linux, I use Spyder for my dev-ops environment, although the error will occur in other developer platforms. Simply, when test-running a program, it fails to launch, and the log reports a "xlib error displayconnectionerror cant connect to display" error.
The issue is within neither the developer platform or your code, but in the supporting libraries within the Linux distribution of Python, and has an easy update fix.
Open a terminal window (CTRL-Alt-T), and enter the command
xhost +
Let that run, and then enter the command
sudo apt-get install python3-tk python3-dev
Close the terminal, re-open your developer platform, and run your code.
No comments:
Post a Comment