[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:09:00 +0000 |
Hi Rob
On Thu, Mar 7, 2019 at 7:06 PM Rob Shinn <address@hidden> wrote:
>
> Excuse me for butting in, but to illustrate why you're getting
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "gps.py", line 23, in <module>
> from .client import *
>
> I'll just show you this:
>
> address@hidden:/mnt/c/Users/rshinn/source$ git clone
> https://git.savannah.gnu.org/git/gpsd.git/ gpsd
> Cloning into 'gpsd'...
> remote: Counting objects: 61957, done.
> remote: Compressing objects: 100% (21723/21723), done.
> remote: Total 61957 (delta 40211), reused 61957 (delta 40211)
> Receiving objects: 100% (61957/61957), 110.80 MiB | 10.77 MiB/s, done.
> Resolving deltas: 100% (40211/40211), done.
> Checking connectivity... done.
> address@hidden:/mnt/c/Users/rshinn/source$ cd gpsd
> address@hidden:/mnt/c/Users/rshinn/source/gpsd$ python -c "import gps"
> address@hidden:/mnt/c/Users/rshinn/source/gpsd$ cd gps
> address@hidden:/mnt/c/Users/rshinn/source/gpsd/gps$ python -c "import gps"
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "gps.py", line 23, in <module>
> from .client import *
> ValueError: Attempted relative import in non-package
>
> 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/
My presumption about making a newbie mistake would appear to be correct (-:
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" is waf/python also searching for a matching
directory name, or is there something else in the gpsd directory that
it is using ?
Cheers
Arne
- [gpsd-users] using the python gps module without scons install, shouldbe q931, 2019/03/06
- Re: [gpsd-users] using the python gps module without scons install, Gary E. Miller, 2019/03/06
- Message not available
- Re: [gpsd-users] using the python gps module without scons install,
shouldbe q931 <=
- Re: [gpsd-users] using the python gps module without scons install, Gary E. Miller, 2019/03/07
- Re: [gpsd-users] using the python gps module without scons install, shouldbe q931, 2019/03/07
- Re: [gpsd-users] using the python gps module without scons install, Gary E. Miller, 2019/03/07
- Re: [gpsd-users] using the python gps module without scons install, shouldbe q931, 2019/03/07
- Re: [gpsd-users] using the python gps module without scons install, Gary E. Miller, 2019/03/07
- Re: [gpsd-users] using the python gps module without scons install, shouldbe q931, 2019/03/08