gpsd-users
[Top][All Lists]
Advanced

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

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


From: shouldbe q931
Subject: Re: [gpsd-users] using the python gps module without scons install
Date: Thu, 7 Mar 2019 22:53:33 +0000

Hi Gary

On Thu, Mar 7, 2019 at 10:19 PM Gary E. Miller <address@hidden> wrote:
>
> Yo shouldbe!
>
> On Thu, 7 Mar 2019 22:09:00 +0000
> shouldbe q931 <address@hidden> wrote:
>
> > > That should help you adjust your PYTHONPATH. :)
> > >
> >
> > I looked at the above for over half a dozen times before I realised
> > that there was no error when the command was run in gpsd/ rather than
> > gpsd/gps/
>
> Sorry, I thought the clockmaker script was clear on that.  Please submit
> a patch to the doc if you have a way to make that clearer.
>
I did not have any issue building gpsd, which obviously needs scons to
be run in the directory that gpsd has been cloned to or untarred to.
Because I had misunderstood from the python documentation what path I
needed to provide in $PYTHONPATH for ntpsec to "build" ntploggps, I
was under the misunderstanding that "something else" needed to be done
after building gpsd, rather than as Rob pointed out, simply using the
gpsd directory in $PYTHONPATH instead of gpsd/gps
>
> Try not to confuse how you install and use gpsd with clockmaker, versus
> the normal install and useage.
>
I don't see a difference between the two apart from just calling scons
on its own and calling scons with several "configure alike" statements
>
> > If I can ask a followup question, I had taken
> > https://docs.python.org/2/tutorial/modules.html#the-module-search-path
> > where it says "When a module named spam is imported, the interpreter
> > first searches for a built-in module with that name. If not found, it
> > then searches for a file named spam.py in a list of directories given
> > by the variable sys.path"
>
>
> Yup.  And PYTHONPATH gets folded into sys.path.  So the way a user
> adjusts sys.patch is with PYTHONPATH.
>
> > is waf/python also searching for a matching
> > directory name, or is there something else in the gpsd directory that
> > it is using ?
>
> Lost me.  There is no waf/python.
>
Apologies, I used "waf/python"  instead of "waf and/or python"
>
> When you run a python program in the location that clockmaker tells you to,
> then the gps is in that directory (.), which is in sys.path.
>
In the clockmaker script, ./waf configure (with some additional
options) is run in ntpsec/, not in gpsd/
>
> Easy to see you sys.path:
>
>     $ python
>     Python 2.7.15 (default, Sep 12 2018, 11:58:35)
>     [GCC 8.2.0] on linux2
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> import sys
>     >>> sys.path
>     [...]
>

I'm not trying to make a "better" clockmaker script, I'm using it as
an initial base to learn how to be able to a scripted install of gpsd
and ntpsec running as separate services, and to have the logging for
ntpviz installed as well

Cheers

Arne



reply via email to

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