# Ds9 problem --- can't find package xml

**URL:** <https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698>\
**Category:** Support\
**Created:** [May 12, 2019, 7:02pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698 "2019-05-12T19:02:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brnikat](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/brnikat/32/866_2.png) [@Brnikat](https://www.rubin.community/u/Brnikat)\
**Post date:** [May 12, 2019, 7:02pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/1 "2019-05-12T19:02:08Z")

</div>

A problem with the tutorial at `https://pipelines.lsst.io/getting-started/display.html` : ds9 doesn’t display pretty pictures.

An instance of ds9 was fired up in a separate terminal. A Pyraf session chatted to it without issue. Working through the tutorial, all seemed ok up to and including  
`>>> display = afwDisplay.getDisplay()`  
but then

```auto
>>> display.mtv(calexp)
ds9 doesn't appear to be running (XPA: 
  File "python/lsst/display/ds9/xpa.cc", line 115, in const char* lsst::display::ds9::{anonymous}::XPASet1(XPA, char*, char*, char*, char*, int)
    XPASet returned 0 {0}
lsst::pex::exceptions::IoError: 'XPASet returned 0'
, (;iconify no; raise)), I'll try to exec it for you
Error in startup script: can't find package xml
    while executing
"package require xml"
    ("x11" arm line 10)
    invoked from within
"switch $ds9(wm) {
    x11 {
	# set to absolute path so that if -cd command is used,
	# so we can still find our files
	set ds9(root) [file normalize [..."
    (file "/usr/share/saods9/library/ds9.tcl" line 195)
XPA$ERROR no 'xpaset' access points match template: ds9
Error writing image: : Broken pipe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/src/lsst_stack/stack/miniconda3-4.5.4-fcd27eb/Linux64/afw/17.0.1/python/lsst/afw/display/interface.py", line 551, in mtv
    self._impl._mtv(data.getImage(), data.getMask(), wcs, title)
  File "/usr/local/src/lsst_stack/stack/miniconda3-4.5.4-fcd27eb/Linux64/display_ds9/17.0.1/python/lsst/display/ds9/ds9.py", line 306, in _mtv
    _i_mtv(image, wcs, title, False)
  File "/usr/local/src/lsst_stack/stack/miniconda3-4.5.4-fcd27eb/Linux64/display_ds9/17.0.1/python/lsst/display/ds9/ds9.py", line 485, in _i_mtv
    raise e
  File "/usr/local/src/lsst_stack/stack/miniconda3-4.5.4-fcd27eb/Linux64/display_ds9/17.0.1/python/lsst/display/ds9/ds9.py", line 478, in _i_mtv
    displayLib.writeFitsImage(pfd.fileno(), data, wcs, title)
lsst.pex.exceptions.wrappers.RuntimeError: 
  File "python/lsst/afw/display/simpleFits.cc", line 441, in void lsst::afw::display::writeBasicFits(int, const ImageT&, const lsst::afw::geom::SkyWcs*, const char*) [with ImageT = lsst::afw::image::Image<float>]
    Error writing data for row 10 {0}
lsst::pex::exceptions::RuntimeError: 'Error writing data for row 10'
>>> 

```

It most certainly is running.

Attempting to fire up a ds9 from the same shell as the one running the tutorial:

```auto
Error in startup script: can't find package xml
    while executing
"package require xml"
    ("x11" arm line 10)
    invoked from within
"switch $ds9(wm) {
    x11 {
	# set to absolute path so that if -cd command is used,
	# so we can still find our files
	set ds9(root) [file normalize [..."
    (file "/usr/share/saods9/library/ds9.tcl" line 195)
(lsst-scipipe-fcd27eb) pcl@thoth:~/Astro/lsst$ 

```

which confuses me. Why does ds9 work in one environment but not the other? Yes, I had run `setup display_ds9` as gleaned from another post where ds9 problems were reported.

Ho hum. We’ll get there in the end, I’m sure.

---

<div class="post-metadata">

**Author:** ![merlin](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/merlin/32/2652_2.png) [@merlin](https://www.rubin.community/u/merlin)\
**Post date:** [May 13, 2019, 12:19pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/2 "2019-05-13T12:19:52Z")

</div>

I suspect this will be to do with not having set your `XPA_PORT` environment variable.

Some guidance on that [might be found here](http://www.rubin.community/t/using-an-lsst-dev-stack-w-local-ipython-ds9-tutorial/592), though it covers more than just this issue for sure.

---

<div class="post-metadata">

**Author:** ![Brnikat](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/brnikat/32/866_2.png) [@Brnikat](https://www.rubin.community/u/Brnikat)\
**Post date:** [May 13, 2019, 1:38pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/3 "2019-05-13T13:38:21Z")

</div>

Thanks Merlin,

I couldn’t find anything at that link and its children which I was able to use to get things working.  
Perhaps I should emphasise that everything is running locally so why should all the stuff about X11 tunnelling be applicable?

Firing up `ds9 -xpa info` with no other arguments produces a message box as follows

```auto
XPA_VERSION: 2.1.18
XPA_CLASS: DS9
XPA_NAME: ds9
XPA_METHOD 7f000001:ppppp

```

where 7f000001 is recognizably the IPv4 loopback address, aka localhost, and ppppp is a non-privileged port number which varies from run to run.

Perhaps I should also have been more explicit that this is a Ubuntu 18.10 box running Ubuntu’s distribution of ds9.

Trying variations on `export XPA_METHOD=localhost`, `export XPA_METHOD=7f000001`, with or without the port number didn’t help.

I don’t know what “can’t find package xml” appears, but perhaps that’s a red herring.

---

<div class="post-metadata">

**Author:** ![Brnikat](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/brnikat/32/866_2.png) [@Brnikat](https://www.rubin.community/u/Brnikat)\
**Post date:** [May 13, 2019, 2:15pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/4 "2019-05-13T14:15:24Z")

</div>

Solved it, after much grubbing around on the interweb thingy. On this Ubuntu box `sudo apt install xpa-tools; xpans` did The Right Thing.

Perhaps advice to this effect could be added to the installation and / or tutorial material?

Paul

---

<div class="post-metadata">

**Author:** ![Yuanyu](https://avatars.discourse-cdn.com/v4/letter/y/ba8739/32.png) [@Yuanyu](https://www.rubin.community/u/Yuanyu)\
**Post date:** [December 2, 2021, 11:31am UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/5 "2021-12-02T11:31:35Z")

</div>

Recently, I run into the same problem in my Centos7(not Ubuntu), and when `I sudo yum install xpa-tools`. It remind me no package available. I search and tried to solve it for one day. And I didn’t really resolve that, but I find a simple solution:

> Just open a new terminal, in that terminal, open your ds9

It may sounds kinda stupid, but I hope other people who occur the problem can try this method without wasting their time to try to solve

```auto
XPA$ERROR no 'xpaset' access points match template: ds9

```

And if anyone who know how to really solve it on Centos, please tell me, thank you!

---

<div class="post-metadata">

**Author:** ![prajakta1-618](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/prajakta1-618/32/1963_2.png) [@prajakta1-618](https://www.rubin.community/u/prajakta1-618)\
**Post date:** [April 6, 2022, 6:31pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/6 "2022-04-06T18:31:24Z")

</div>

Hey @Yuanyu ,  
I am getting the same error as you

> XPA$ERROR no ‘xpaset’ access points match template: ds9  
> Error writing image: : Broken pipe

on CentOs 7. I tried your solution. Opened ds9 in a new terminal window and tried to run `display.mtv(calexp)` again. But it does not work for me and gives the same error again.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![prajakta1-618](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/prajakta1-618/32/1963_2.png) [@prajakta1-618](https://www.rubin.community/u/prajakta1-618)\
**Post date:** [April 7, 2022, 5:30am UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/7 "2022-04-07T05:30:34Z")

</div>

Hi, it actually works if I launch ds9 after setting up the lsst environment in the new terminal window.  
Thanks!

---

<div class="post-metadata">

**Author:** ![abernard](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@abernard](https://www.rubin.community/u/abernard)\
**Post date:** [June 20, 2024, 9:31am UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/8 "2024-06-20T09:31:37Z")

</div>

As of 06/2024, using the latest version, on a Debian 6.1.90-1, I encountered the same issue.  
I think adding a line in the tutorial would be beneficial as suggested by [Brnikat](http://www.rubin.community/u/Brnikat).

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [June 20, 2024, 3:42pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/9 "2024-06-20T15:42:00Z")

</div>

Hi all, thanks for this. Quick note to say I’m working towards adding a note in the tutorial as suggested. Will report back with a link when it’s done.

---

<div class="post-metadata">

**Author:** ![MelissaGraham](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/melissagraham/32/2549_2.png) [@MelissaGraham](https://www.rubin.community/u/MelissaGraham)\
**Post date:** [June 27, 2024, 8:00pm UTC](https://www.rubin.community/t/ds9-problem-cant-find-package-xml/3698/10 "2024-06-27T20:00:25Z")

</div>

The documentation has been updated, thanks again for raising this.
