Openembedded opkg packages for python contain pyc files. I looked at python3-dbus, and I do not see a post-install step. All python related files except the SO files are in /usr/lib/python3.8/site-packages/dbus.
If I install the Python GPS source + the compiled pyc files into:
/usr/lib/python3.8/site-packages/gps
/usr/lib/python3.8/site-packages/gps/__pycache__
If I then try to import the gps library I see:
>>> import gps
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mtadm/gps/__init__.py", line 10, in <module>
from .gps import *
File "/home/mtadm/gps/gps.py", line 23, in <module>
from gpsclient import gpscommon, json_error, gpsjson, dictwrapper, GPSD_PORT
ModuleNotFoundError: No module named 'gpsclient'
Now if I compile one file in /usr/lib/python3.8/__pycache__ and copy it into place the problem goes away (the following copies one file from a tree of freshly compiled pyc files):
/tmp/python3.8/__pycache__$ sudo cp -a textwrap.cpython-38.pyc /usr/lib/python3.8/__pycache__/
Password:
ot0:/tmp/python3.8/__pycache__$ cd /
ot0:/$ python
Python 3.8.11 (default, Mar 9 2018, 12:34:56)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gps
>>>
I would hope there would be some other way to get the GPS library to work.
pip3 install gps --user
?