Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

Problems for load gpstk python, anyone help me please. #21

Closed
malliwi88 opened this issue Oct 3, 2016 · 4 comments
Closed

Problems for load gpstk python, anyone help me please. #21

malliwi88 opened this issue Oct 3, 2016 · 4 comments

Comments

@malliwi88
Copy link

I try to run this code

import sys
print(sys.version)
from gpstk import *

but obtain this output

2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-2fd3bb2e053c> in <module>()
      1 import sys
      2 print(sys.version)
----> 3 from gpstk import *

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/__init__.py in <module>()
      5 # Populate gpstk namespace
      6 #----------
----> 7 from gpstk import *

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/gpstk.py in <module>()
  24759     return _gpstk.SatelliteYawAngle(P, V, Sun, blkIIRF)
  24760 
> 24761 def now(timeSystem=TimeSystem('UTC')):
  24762     """
  24763     Returns the current time (defined by what SystemTime() returns)

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/gpstk.py in __init__(self, *args)
   9125         this = _gpstk.new_TimeSystem(*args)
   9126         try:
-> 9127             self.this.append(this)
   9128         except Exception:
   9129             self.this = this

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/gpstk.py in <lambda>(self, name)
   9036     __setattr__ = lambda self, name, value: _swig_setattr(self, TimeSystem, name, value)
   9037     __swig_getmethods__ = {}
-> 9038     __getattr__ = lambda self, name: _swig_getattr(self, TimeSystem, name)
   9039     __repr__ = _swig_repr
   9040     Unknown = _gpstk.TimeSystem_Unknown

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/gpstk.py in _swig_getattr(self, class_type, name)
     72 
     73 def _swig_getattr(self, class_type, name):
---> 74     return _swig_getattr_nondynamic(self, class_type, name, 0)
     75 
     76 

/home/zenbook/anaconda3/envs/py27/lib/python2.7/site-packages/gpstk/gpstk.py in _swig_getattr_nondynamic(self, class_type, name, static)
     67         return method(self)
     68     if (not static):
---> 69         return object.__getattr__(self, name)
     70     else:
     71         raise AttributeError(name)

AttributeError: type object 'object' has no attribute '__getattr__'

Anyone have some idea about this problem??

Additional details

  • i have a python2.7 conda enviroment in $HOME/anaconda3/envs/py27/lib/python2.7/
  • detail the last lines on bashrc
$ ▶ tail -5 ~/.bashrc | head -5
# added by Anaconda3 4.2.0 installer
export PATH="/home/zenbook/anaconda3/bin:$PATH"
export LD_LIBRARY_PATH=$HOME/anaconda3/envs/py27/lib:/usr/lib:$HOME/.local/gpstk/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$HOME/anaconda3/envs/py27/lib/python2.7/site-packages:$HOME/.local/gpstk/lib:$PYTHONPATH
export PATH=$HOME/.local/gpstk/bin:$PATH
@ncouro
Copy link

ncouro commented Oct 14, 2016

I've had the same problem on Ubuntu 16.04 and the cause was a bug in SWIG 3.0.8 shipped with that distribution.
I've installed SWIG 3.0.10 from source, re-built GPSTk and it worked.

@cartoocm
Copy link

I solved this problem with older version of swig.
Important: read carefully the manual :(

Thanks

@malliwi88
Copy link
Author

Hi @cartoocm @ncouro

Could you give me any details about how you compile swig 3.0.10? Which distro you use @ncouro ?

@malliwi88
Copy link
Author

malliwi88 commented Oct 22, 2016

Hi. I solve my problem

The compressed archive that is available in Sources Swig 3.0.10 have problems with the configuration file.

I've downloaded the official website here
The indications for anyone who may have the same problem.

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

No branches or pull requests

4 participants