RuntimeError: Unable to set backend to lsst.display.ds9: "No module named lsst.display.ds9" (is display_ds9 setup?)

If I encounter the following error:

RuntimeError: Unable to set backend to lsst.display.ds9: "No module named lsst.display.ds9" (is display_ds9 setup?)

after

import lsst.afw.display as afwDisplay
afwDisplay.ds9.mtv(exp, frame=f, title='CCD')

(assume I have a legitimate exp object)

What troubleshooting steps should I take?

What corrective action should I take?

The flippant answer wold be to install the display_ds9 package. Everything works until you try to talk to DS9 and it realizes the DS9 plugin is not available on your system. It decides it shouldn’t carry on since you explicitly asked to talk to DS9. display_ds9 is currently an optional package in lsst_apps.

@timj Thank you. That is in fact exactly what I needed to be told.

I have setup display_ds9 and now (in a new session launched from the updated environment):

afwDisplay.ds9.mtv(exp, title='Coadd')

Runs and never returns or displays.

What steps should I take to troubleshoot?

Do you have DS9 running already?

yes

(post is now 20 characters)

In keeping with the recent discussions about communication tools, I’d suggest that chat is more appropriate for debugging/diagnosing the details of the problem (as opposed to extended-to-20-character messages here). A solution can be posted back here when found.

I ran into something similar last week. Apparently, I had to setup display_ds9 and had to have ds9 open (I think this is what @timj meant by ‘running’) from a different terminal before I could use this.

You’re mixing paradigms here. You’re expected to write:

import lsst.afw.display as afwDisplay
disp = afwDisplay.Display(frame=0)
disp.mtv(im)

The backend will default to x11 if display_ds9 is setup, or you can set the default backend, or add an argument backend='X11' to the Display call.