5

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
fgh
  • 81

1 Answers1

2

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

peterh
  • 2,782
emestre
  • 21