Sample Header Ad - 728x90

How does one install a python3 library in yocto/opkg?

0 votes
0 answers
881 views
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 "", line 1, in File "/home/mtadm/gps/__init__.py", line 10, in from .gps import * File "/home/mtadm/gps/gps.py", line 23, in 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.
Asked by John Klug (363 rep)
Apr 28, 2022, 09:32 PM