Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676902 - app-emulation/virt-manager-2.0.0 - Traceback (most recent call last): File "/usr/share/virt-manager/virt-manager", line 16, in <module> import gi ImportError: No module named 'gi'
Summary: app-emulation/virt-manager-2.0.0 - Traceback (most recent call last): File ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 12:02 UTC by Liam Dennehy
Modified: 2019-07-01 16:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info.txt,5.98 KB, text/plain)
2019-01-30 12:06 UTC, Liam Dennehy
Details
emerge --info (emerge.--info.txt,17.97 KB, text/plain)
2019-02-05 01:49 UTC, Ilya Mochalov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Liam Dennehy 2019-01-30 12:02:54 UTC
After emerge @world update that pulled in virt-manager-2.0.0, virt-manager command fails, emits error:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager", line 16, in <module>
    import gi
ImportError: No module named 'gi'

Command "pydoc modules" does not list gi as installed, though no idea what expected bahaviour is. Also causes all invocations of virt-manager to fail (--version, --help etc).
Comment 1 Liam Dennehy 2019-01-30 12:06:37 UTC
Created attachment 563260 [details]
emerge --info
Comment 2 Liam Dennehy 2019-01-30 12:34:10 UTC
Why do I look, search and poke, give up and decide it's time to file a bug...

Only to then do a fraction of the effort and find the cause?

virt-manager-2.0.0 has USE flag python_single_target_python3_6, while system (eselect) is set to python3.4 - noticed when dumping files for pygobject package only listing 3.6 gi module.

"/usr/bin/python3.6 /usr/share/virt-manager/virt-manager" succeeds.

- Is it useful for a package to explicitly USE python3.6, but the launch script still uses "/usr/bin/env python3" so could incorrectly match the system setting?
- Should the launch script not explicitly invoke the python version it was built for, instead of forcing the user to make a system-wide choice towards that version?
Comment 3 Ilya Mochalov 2019-02-05 01:49:17 UTC
I have the same problem.
Comment 4 Ilya Mochalov 2019-02-05 01:49:58 UTC
Created attachment 563768 [details]
emerge --info
Comment 5 mod 2019-02-07 14:11:58 UTC
Confirmed that calling python3.6 manually per Liam works as a workaround on my affected machine.
Comment 6 Luca Chiampo 2019-03-07 11:02:39 UTC
Same problem for me.
Also for me after @world update
Also for me "/usr/bin/python3.6 /usr/share/virt-manager/virt-manager" succeeds.
Comment 7 Benedikt Reinartz 2019-06-30 12:08:18 UTC
I have this issue with a separately installed Anaconda instance that is picked up by the `#/usr/bin/env python3` shebang used in all virt-manager scripts. Is there a policy somewhere on how the shebang for scripts should look like in Gentoo?
Comment 8 Larry the Git Cow gentoo-dev 2019-07-01 16:59:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3060d4866a3dca772688ecd150aae9c23b73b5d0

commit 3060d4866a3dca772688ecd150aae9c23b73b5d0
Author:     Matthias Maier <tamiko@gentoo.org>
AuthorDate: 2019-07-01 16:49:31 +0000
Commit:     Matthias Maier <tamiko@gentoo.org>
CommitDate: 2019-07-01 16:59:26 +0000

    app-emulation/virt-manager: fix shebang
    
    Closes: https://bugs.gentoo.org/676902
    Package-Manager: Portage-2.3.68, Repoman-2.3.16
    Signed-off-by: Matthias Maier <tamiko@gentoo.org>

 app-emulation/virt-manager/virt-manager-2.2.0.ebuild | 3 ++-
 app-emulation/virt-manager/virt-manager-9999.ebuild  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)