gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] using the python gps module without scons install


From: shouldbe q931
Subject: [gpsd-users] using the python gps module without scons install
Date: Wed, 6 Mar 2019 18:08:20 +0000

Hello,

I'm trying to muddle my way through to modify the ntpsec clockmaker
script to also build ntploggps. ntploggps has a dependancy for the
python gps module, which I have learnt is is built if python=yes is
added to the scons "timeservice=yes" line.

If I "sudo scons install", the python module is "installed" and the
waf "configure" sees the module and builds ntploggps automatically.

Although this technique works, it adds two more steps to the
clockmaker script, and am trying to not add any more steps.

In an attempt to get around adding two more steps to the clockmaker
script,  I first tried just adding the path /home/pi/gpsd/gps/gps.py
to $PATH and that had no effect, then I tried adding the path to to
$PYTHONPATH as per
https://docs.python.org/3/tutorial/modules.html#the-module-search-path,
which when ./waf configure, is run the ntpsec/build/config.log shows
that it found the gps.py, but then has the "relative import in non
package" error as below.
----------------------------------------------------------------
Checking for python module 'gps' (ver >= num(3, 18))
['/usr/bin/python', '-c', "\nimport gps as current_module\nversion =
getattr(current_module, '__version__', None)\nif version is not
None:\n\tprint(str(version))\nelse:\n\tprint('unknown version')\n"]
err: Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/home/pi/gpsd/gps/gps.py", line 23, in <module>
    from .client import *
ValueError: Attempted relative import in non-package

Am I attempting the impossible, or is there a way of "creating" the
python gps module without needing a "sudo scons install" ?

Cheers

Arne



reply via email to

[Prev in Thread] Current Thread [Next in Thread]