How does PIL find the viewer to use for imshow() on Ubuntu?
I notice it’s trying to use “xv”, but I only have “display” available
In my previous installation of Python where it correctly found “display” with no hacking from me. Any idea what environment vars/settings I need to check?
I’m Python 2.6.5, Ubuntu 10.04, PIL 1.1.6
PIL finds the viewer in
ImageShow.py. It usesPATHto search for the executable, so check to make suredisplayis on yourPATH. You can check out the code if you want more details.Anyway, it’s possible to override PIL’s choice. If you want to use
display, useImageShow.register(ImageShow.DisplayViewer). For other viewers, subclassImageShow.UnixViewer, implementget_command_ex, and register the new viewer class (seeImageShow.pyfor details).