1

The tutorial that I am using is the following: https://heasarc.gsfc.nasa.gov/xanadu/xspec/python/html/buildinstall.html

I have finished the installation till ..Once HEASOFT is finished building and installing, you should find PyXspec’s code files and lib_pyXspec.so library in the directory $HEADAS/lib/python/xspec.

However, when I run $HEADAS/headas-init.csh, it asks for superuser permission and when I use sudo, it gives me an error saying that command was not found. Then I tried to set the PYTHONPATH environment manually using:

>>> sys.path
['', '/usr/local/lib/python2.7/dist-packages/pyds9-1.9.dev0-py2.7-linux-x86_64.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
>>> 
>>> sys.path.append("$HEADAS/lib/python")
>>> import xspec
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "xspec/__init__.py", line 66, in <module>
    from .chain import ChainManager, AllChains, Chain
  File "xspec/chain.py", line 4, in <module>
    from . import _pyXspec
ImportError: libXSUser.so: cannot open shared object file: No such file or directory

But that did not work either. How do I install this?

Thank you

1 Answers1

0

From what I'm reading, it looks like it may be an issue with the way sys.path performs searches.
The two most relevant posts I could find on the matter were these:

http://askubuntu.com/questions/593333

and Why can't Python find shared objects that are in directories in sys.path?

Community
  • 1
  • 1
  • I ran `$LD_LIBRARY_PATH` from the terminal (as suggested by the post here: https://stackoverflow.com/a/1100016/3243703), but it said that the variable is undefined. So, I executed `env | grep '^LD_LIBRARY_PATH'` and it gave no output. Does that mean that the variable is empty and I need to use the following command to add the path: `export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH`? – Always Learning Forever Aug 11 '17 at 00:58
  • That's what I would try, but I'm no expert, admittedly. Just wanted to try leading you in the right direction. – Jay Bennett Aug 11 '17 at 01:03