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

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

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

Comments

Projects
None yet
4 participants
@malliwi88

malliwi88 commented Oct 3, 2016

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

This comment has been minimized.

Show comment
Hide comment
@ncouro

ncouro 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.

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

This comment has been minimized.

Show comment
Hide comment
@cartoocm

cartoocm Oct 14, 2016

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

Thanks

cartoocm commented Oct 14, 2016

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

Thanks

@malliwi88

This comment has been minimized.

Show comment
Hide comment
@malliwi88

malliwi88 Oct 22, 2016

Hi @cartoocm @ncouro

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

malliwi88 commented Oct 22, 2016

Hi @cartoocm @ncouro

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

@malliwi88

This comment has been minimized.

Show comment
Hide comment
@malliwi88

malliwi88 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.

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 join this conversation on GitHub. Already have an account? Sign in to comment