_tkinter.TclError: couldn't connect to display "localhost:0.0" matplotlib bash on windows

Insipired by the problems with displaying matplotlib used in a Python script using the terminal of the Bash (Ubuntu) on Windows, I have followed the instructions listed in the first answer. However, after restarting the computer, suddenly I get an error:

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

Do you have any idea how to fix it and display images?

Citing the mentioned post, I have:

  1. Downloaded and installed Xming
  2. sudo apt-get update
  3. sudo apt-get install python3.6-tk
  4. (installed matplotlib earlier)
  5. export DISPLAY=localhost:0.0 and added to ~/.bashrc
2

1 Answer

Don't forget to open the Xming application on Windows before running the script in the Ubuntu subsystem.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like