Hello, this is Umair Khan from the Portland State Aerospace Society.
I'm trying to get a new front-end up and running in Python 3.6 and I can't seem to get the SWIG wrapper working properly. This may be more of a SWIG question than an OpenStarTracker question but I figured it would be worth asking about here. To try and isolate the problem, I'm trying to first get things working with the base OpenStarTracker code from the master branch.
I changed the Python path in unit_test.sh to point to my Python 3.6 installation and then changed the Python headers in the Makefile in the beast directory to point to the 3.6 version. Then when I ran startracker.py I got the following error message:
Loading config
science_cam_may8_0.05sec_gain40/calibration.txt
Traceback (most recent call last):
File "startracker.py", line 41, in <module>
beast.load_config(CONFIGFILE)
AttributeError: module 'beast' has no attribute 'load_config'
It seems that the beast module Python is importing is completely empty. If I comment out the load_config line then the same error shows up with the S_DB = beast.star_db() line. But when I check the beast.py file generated by SWIG, everything's in there as per usual.
When I import beast from an interactive Python 3.6 session and use the inspect module, it shows that the imported module is basically empty. Interestingly, when I try and import beast from an interactive Python 2.7 session (with beast made for Python 2.7), it throws an exception:
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import beast
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "beast/__init__.py", line 1, in <module>
from beast import *
File "beast/beast.py", line 17, in <module>
_beast = swig_import_helper()
File "beast/beast.py", line 16, in swig_import_helper
return importlib.import_module('_beast')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _beast
Not quite sure what's going on here since beast.py seems to have all the functionality needed no matter what version of the Python headers I use. Can anyone shed some light? Thanks.
Best,
Umair