gpsd-users
[Top][All Lists]
Advanced

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

Re: ✘Major build change pushed


From: Gary E. Miller
Subject: Re: ✘Major build change pushed
Date: Fri, 13 Nov 2020 11:56:37 -0800

Yo Curtis!

On Fri, 13 Nov 2020 13:17:22 -0600
Curtis Olson <curtolson@flightgear.org> wrote:

> Can you give any guidance on how to properly run the python "client"
> scripts within this new architecture?  My first attempt reported:
> 
> ./gpssubframe: can't load Python gps libraries -- check PYTHONPATH.
> No module named 'gps'

gpsd # cd gpsd-3.21.1~dev/
gpsd/gpsd-3.21.1~dev # ./clients/gpssubframe -h
usage: gpssubframe [OPTIONS] [host[:port[:device]]]

> My second attempt (with PYTHONPATH set to "${GPSD_SOURCE_ROOT}/gps"
> reported:
> 
> ./gpssubframe: can't load Python gps libraries -- check PYTHONPATH.
> attempted relative import with no known parent package

I can't tell you your proper PYTHONPATH.  When you build gpsd the
build log tells you.



> I always feel like I get lucky when I get my own python project
> imports to work from a different path.  Has this been tested in the
> new build layout, or am I just missing something or doing something
> dumb?

Easy, one you know the trick.  The current working directory is
always chacked first.  So the easiest thing is to run the python program
in the directory that contains the python module.

For current git head that is, gpsd/gpsd-3.21.1~dev, which contains
the gps/ direectory.  gps/ is the Python module.

Most peoppel will just install the module, and add the installed
directory, the PYTHONPATH that the build tells you, to your PYTHONPATH.
Ffor me that is:

        export PYTHONPATH=/usr/local/lib64/python3.9/site-packages

If you do not want to install, but instead run from the build directory,
then set your PYTHONPATH to that.  In my case that is:

gpsd/gpsd-3.21.1~dev # pwd
/usr/local/src/GPS/gpsd/gpsd-3.21.1~dev
gpsd/gpsd-3.21.1~dev # export PYTHONPATH=/usr/local/src/GPS/gpsd/gpsd-3.21.1~dev

When in doubt: print(os.sys.path)

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpsuEkTuu9Y5.pgp
Description: OpenPGP digital signature


reply via email to

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