Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xpa module conflicts with pyds9 #122

Closed
olebole opened this issue Nov 20, 2017 · 8 comments
Closed

xpa module conflicts with pyds9 #122

olebole opened this issue Nov 20, 2017 · 8 comments

Comments

@olebole
Copy link

olebole commented Nov 20, 2017

Original bug (Ubuntu): https://bugs.launchpad.net/bugs/1733352

Imexam does not play together with pyds9. While both have overlapping use cases, it may be good that a user has the opportunity to install and use them in parallel. One way could be to make the package a subpackage of imexam, another to agree on a common xpa package.

See also ericmandel/pyds9#58 for the pyds9 issue.

@sosey
Copy link
Member

sosey commented Nov 20, 2017

@olebole can you comment further on how the xpa module conflicts with imexam?

The xpa C code is a submodule of imexam, imexam uses a cython wrapper to access it's functions and interface with DS9. pyds9 (last time I looked) used ctypes for it's interface.

While the two packages do have overlap, imexam provides a library of methods that help examine and plot images, not just provide access into the xpa ds9 functions. I haven't seen an issue with installing both packages on the same machine, could you give me an example of where or how this is failing for you?

thanks!
megan

@sosey
Copy link
Member

sosey commented Nov 20, 2017

I did take a quick look at the bug report you listed, but I don't see anything there that would lead me to believe that having imexam installed in the environment would conflict with importing pyds9. Maybe there's a script install somewhere that's clobbering between the two packages ... I haven't investigated it on my machine yet, but I'll give it a go this afternoon.

@olebole
Copy link
Author

olebole commented Nov 20, 2017

I can confirm the bug; when I installed imexam and pyds9, then I get the following when running:

In [1]: import pyds9
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-cc12a0b41e5c> in <module>()
----> 1 import pyds9

/usr/lib/python2.7/dist-packages/pyds9.py in <module>()
    798 # case where xpa is not installed, and ds9 is started before python
    799 if "PYDS9_NOXPANS" not in os.environ.keys():
--> 800     ds9_xpans()
    801 
    802 

/usr/lib/python2.7/dist-packages/pyds9.py in ds9_xpans()
    249     of ds9 is displayed.
    250     """
--> 251     if xpa.xpaaccess(b"xpans", None, 1) is None:
    252         _fname = ds9Globals["progs"][0]
    253         if _fname:

AttributeError: 'module' object has no attribute 'xpaaccess'

I think this is because wrappers/xpa.pyx goes to the top namespace?

@sosey
Copy link
Member

sosey commented Nov 20, 2017

yah, lemme check that out..

@montefra
Copy link

In pyds9 version <= 1.8.1, pyds9.py and xpa.py got installed at the site-packages level. I think that this is what is causing the issue. The next version of pyds9 should have both into a pyds9 directory and might solve the problem. But I don;'t know yet when the new version will be ready.

@jehturner
Copy link

We also ran into this, but it appears to be fixed with pyds9 1.9.0.dev.

@sosey sosey closed this as completed Mar 28, 2018
@jehturner
Copy link

PS. Putting a module named xpa directly into site-packages nevertheless seems inadvisable 😉.

@sosey
Copy link
Member

sosey commented Mar 28, 2018

true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants