ericmandel / pyds9

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

Problem when importing pyds9 #103

Closed DavidIsrayelyan closed 2 years ago

DavidIsrayelyan commented 2 years ago

Hello.

When I simply importing pyds9 using python 3.7.11 I got this kind of error.

Traceback (most recent call last): File "", line 1, in File "/opt/anaconda3/lib/python3.7/site-packages/pyds9.py", line 800, in ds9_xpans() File "/opt/anaconda3/lib/python3.7/site-packages/pyds9.py", line 251, in ds9_xpans if xpa.xpaaccess(b"xpans", None, 1) is None: File "/opt/anaconda3/lib/python3.7/site-packages/xpa.py", line 207, in xpaaccess errmsg += ctypes.string_at(errs[i]).strip() + '\n' TypeError: can't concat str to bytes

How do you think, what may be a problem?

Thank you.

ericmandel commented 2 years ago

I am sorry to say that we no longer have a Python expert working on pyds9 to handle questions of this sort. However, the error message you mention does not match the current xpa.py code:

errmsg += ctypes.string_at(errs[i]).strip() + '\n'

should be:

errmsg += to_string(errs[i]) + '\n'

So if you don't have the latest version of pyds9 from github, I would recommend installing it.

DavidIsrayelyan commented 2 years ago

Thank you very much @ericmandel, I will try to update pyds9 version and rerun it.

DavidIsrayelyan commented 2 years ago

@ericmandel If its not hard for you, may you update pyds9 version in pypi ? I used pip install pyds9, but now I am updating from git. If you may update pyds9 version manual installation for git could be skipped.

ericmandel commented 2 years ago

I can look into this at some point, but I don't have a lot of time to learn about pypi. This is one of the unfortunate consequences of not having a Python expert to help.

DavidIsrayelyan commented 2 years ago

https://widdowquinn.github.io/coding/update-pypi-package/

I think this may help you.

ericmandel commented 2 years ago

I understand that there are pypi install instructions available on the net, but I am trying to say, as gently as possible, that if the community wants a pypi version of pyds9, someone else will have to do it, as I am no longer actively working on DS9 and associated packages. I suppose you might ping the Chandra CIAO software group about supporting pyds9 (they support DS9 itself.) To date, they have been unwilling to put any resources into this package.

DavidIsrayelyan commented 2 years ago

Oh, I got. Okay, Thank you.