spacetelescope / imexam

imexam is a python tool for simple image examination, and plotting, with similar functionality to IRAF's imexamine
http://imexam.readthedocs.io
BSD 3-Clause "New" or "Revised" License
74 stars 45 forks source link

XPA Error "No response from server during handshake" #215

Open jchavez1992 opened 3 years ago

jchavez1992 commented 3 years ago

I am running imexam on a MacOS 10.14.6 using the following setup:

conda 4.8.4
python 3.6.10
ds9 8.1
imexam 0.8.1

I run the following lines in a Python console of PyCharm, and it works great:

viewer = imexam.connect() 
viewer.view(stamp)     # 'stamp' is a numpy array extracted from a fits image
viewer.scale()
viewer.imexam()
viewer.close()

When I try to run it in a script, or in a python session in the terminal, I get the following error: imexam.imexamxpa.XpaException: b'XPA$ERROR: no response from server during handshake (?:?)\n' Sometimes it complains at imexam.connect(), other times it stops atviewer.view(stamp).

I made sure the XPA_METHOD="local". I also tried adding a time.sleep(2) after the connect(), but I am still having trouble. I have also tried going back to ds9=8.0.1, which works for another XPA issue reported here https://github.com/spacetelescope/imexam/issues/186

P.S. Details of the iPython console where it does work:

miniconda3/envs/dragons/bin/python "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py" --mode=client --port=57250
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/jchavez/Work/GSAOIFlats'])
Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 23:06:31) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 7.16.1
Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 23:06:31) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
sosey commented 3 years ago

interesting. Thankyou for the detailed information! I'll try and dig into this with some other bug fixes I hope to push in the next couple weeks.