ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

Error when import pyds9 under RHEL 7.2 #35

Closed zuzuligen closed 8 years ago

zuzuligen commented 8 years ago

Hello: I installed pyds9 through python setup in my computer with RHEL 7.2 and found error when pyds9 was imported in python. The error said:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/site-packages/pyds9.py", line 800, in <module> ds9_xpans() File "/usr/lib/python2.7/site-packages/pyds9.py", line 251, in ds9_xpans if xpa.xpaaccess(b"xpans", None, 1) is None: File "/usr/lib/python2.7/site-packages/xpa.py", line 213, in xpaaccess raise ValueError(errmsg) ValueError: XPA$ERROR: no response from server during handshake (XPANS:xpans) I have already installed saoimage ds9 and set the env with its location.

Thanks again for your help...

Peng

ericmandel commented 8 years ago

@zuzuligen This looks like a problem in which pyds9 is not able to make a socket connection to the xpans (name server) process, possibly due to some OS configuration. You can test this by starting up the xpans program manually and then calling xpaaccess in Python:

The xpans program will be located in your target install directory:

eric% find . -name xpans -exec ls -l {} \;
-rwxr-xr-x  1 eric  staff  141748 Jan  9 09:46 ./lib/python2.7/site-packages/xpans

Once you have found it, just start it at the command line, e.g.:

./lib/python2.7/site-packages/xpans

In a separate shell, start up Python, import pyds9, and execute:

>>> pyds9.xpa.xpaaccess("xpans")
['XPANS:xpans $host:14286']

In your case, I suspect there will be delay of 10 seconds before you get the error message.

Does your OS have any restrictions on which programs can make connections to other programs? Are you using SEL (security-enhanced Linux)?

ericmandel commented 8 years ago

@zuzuligen If you have the permissions, you can also look at the system logs to see what is getting blocked. Try looking at /var/log/secure or /var/log/messages

zuzuligen commented 8 years ago

@ericmandel Problem solved. The install directory was in the unzipped pyds9 directory which was downloaded from github. I reinstalled xpa and set system environment for it. Thank you very much for your help!