The python gki module that comes with dev-util/android-tools isn't installed, causing errors like `ModuleNotFoundError: No module named 'gki'` when trying to run mkbootimg and other python tools that come with this package.
ping. the gki module is in vendor/mkbootimg (the gki folder).
Hi, I've looked into it and I found the cmake only installs mkbootimg/gki/generate_gki_certificate.py from the gki directory here: https://github.com/nmeum/android-tools/blob/master/vendor/CMakeLists.mkbootimg.txt The cmake build system comes from this project, so could you report the issue there as well? https://github.com/nmeum/android-tools/issues Please post the full ModuleNotFoundError traceback so we can see how it's being called.
(In reply to Zac Medico from comment #2) > Hi, I've looked into it and I found the cmake only installs > mkbootimg/gki/generate_gki_certificate.py from the gki directory here: > > https://github.com/nmeum/android-tools/blob/master/vendor/CMakeLists. > mkbootimg.txt > > The cmake build system comes from this project, so could you report the > issue there as well? > > https://github.com/nmeum/android-tools/issues > > Please post the full ModuleNotFoundError traceback so we can see how it's > being called. Hi, actually it looks like the file is indeed being installed but because on Gentoo the python script that running mkbootimg from the terminal calls is not /usr/share/android-tools/mkbootimg/mkbootimg.py but rather /usr/lib/python-exec/python3.12/mkbootimg it doesn't find the generate_gki_certificate that is installed at /usr/share/android-tools/mkbootimg/gki/generate_gki_certificate.py. It works fine if I run /usr/share/android-tools/mkbootimg/mkbootimg.py using this absolute path. ``` Traceback (most recent call last): File "/usr/lib/python-exec/python3.12/mkbootimg", line 31, in <module> from gki.generate_gki_certificate import generate_gki_certificate ModuleNotFoundError: No module named 'gki' ```
I hit this same problem, and it does indeed look like the "gki" module is not installed as per Gentoo python standards, or at least not in the standard location. However, perhaps a better work-around when trying to run mkbootimg would be: PYTHONPATH=/usr/share/android-tools/mkbootimg mkbootimg as I find that works. But this does seem like a corner-case in how Gentoo installs python scripts, so Gentoo python team should probably comment on this further.