Bug 11977

Summary: bitbake -g -u taskexp <target> raises an import exception
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Component: coreAssignee: New Comer Bugs <newcomer>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Medium CC: dakhouya, joshuagloe, meta.mr.watcher, meta.watcher, mshah, randy.macleod, ross.burton, stephano
Version: 2.5   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Leonardo Sandoval Gonzalez 2017-08-24 19:51:17 UTC
When launching the bitbake -g -u taskexp to show task dependencies at UI, the following stack trace shows at command line in my opensuse box.

$ bitbake -g -u taskexp core-image-minimal
Traceback (most recent call last):
  File "/home/lsandov1/poky-testing/poky/bitbake/bin/bitbake", line 48, in <module>
    cookerdata.CookerConfiguration()))
  File "/home/lsandov1/poky-testing/poky/bitbake/lib/bb/main.py", line 372, in bitbake_main
    server_connection, ui_module = setup_bitbake(configParams, configuration)
  File "/home/lsandov1/poky-testing/poky/bitbake/lib/bb/main.py", line 413, in setup_bitbake
    ui_module = import_extension_module(bb.ui, configParams.ui, 'main')
  File "/home/lsandov1/poky-testing/poky/bitbake/lib/bb/main.py", line 106, in import_extension_module
    module = __import__(pkg.__name__, fromlist=[modulename])
  File "/home/lsandov1/poky-testing/poky/bitbake/lib/bb/ui/taskexp.py", line 21, in <module>
    import gi
ImportError: No module named 'gi'
DEBUG: Removed the following variables from the environment: OLDPWD, MINICOM, LS_COLORS, XDG_RUNTIME_DIR, gopher_proxy, LESS, XKEYSYMDB, LESSKEY, HISTSIZE, LS_OPTIONS, HOSTTYPE, SSH_CLIENT, LESS_ADVANCED_PREPROCESSOR, XDG_DATA_DIRS, LIBGL_DEBUG, BUILDDIR, MORE, XDG_CONFIG_DIRS, SSH_SENDS_LOCALE, MACHTYPE, G_FILENAME_ENCODING, FROM_HEADER, HOST, MANPATH, SOCKS5_SERVER, PYTHONSTARTUP, HOSTNAME, SSH_CONNECTION, CSHEDIT, MAIL, OSTYPE, PAGER, SHLVL, LESSCLOSE, INPUTRC, GPG_TTY, SOCKS_PROXY, XNLSPATH, PROFILEREAD, socks_proxy, XDG_SESSION_ID, SSH_TTY, CPU, LESSOPEN, NNTPSERVER, LANG, COLORTERM, _, G_BROKEN_FILENAMES, CONFIG_SITE
lsandov1@yctb05:~/poky-testing/poky/build>
Comment 1 Ross Burton 2017-08-29 14:55:42 UTC
ImportError: No module named 'gi'

You need python-gobject (and GTK+3).

I'm 99% sure this is documented but I guess a nice message would be better than just throwing an exception.
Comment 2 Joshua Lock 2017-12-07 14:48:54 UTC
We should print a message to suggest which modules are missing.
Comment 3 David Khouya 2020-07-01 10:03:14 UTC
Patch was submitted on bitbake-devel
Comment 4 mshah 2021-01-04 06:20:50 UTC
Is this still an open issue? I tried throwing the command "bitbake -g -u taskexp core-image-minimal" but worked fine for me. Tested on branch "dunfell" -> commit hash 16d477fa5d2bec49ccd83ede8249431d30e0c80c.
Comment 6 Randy MacLeod 2021-01-05 19:43:23 UTC
As per David's comment. Thanks everyone!