FS#51247 - [virt-install] missing dependency libvirt-python3

Attached to Project: Community Packages
Opened by Konstantin Gizdov (kgizdov) - Wednesday, 05 October 2016, 18:29 GMT
Last edited by Sergej Pupykin (sergej) - Friday, 07 October 2016, 12:02 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The latest version cannot start if libvirt-python3 isn't installed.

Additional info:
* package version(s) - 1.4.0-2
* config and/or log files etc.


Steps to reproduce:

install virt-install
run virt-install
get error - ImportError: dynamic module does not define init function (initlibvirt)

Steps to fix:
install libvirt-python3
run virt-install
enjoy
This task depends upon

Closed by  Sergej Pupykin (sergej)
Friday, 07 October 2016, 12:02 GMT
Reason for closing:  Not a bug
Comment by Sergej Pupykin (sergej) - Thursday, 06 October 2016, 08:11 GMT
Cannot reproduce:

$ sudo pacman -R libvirt-python3
checking dependencies...

Packages (1) libvirt-python3-2.2.0-1

Total Removed Size: 0.98 MiB

:: Do you want to remove these packages? [Y/n]
:: Processing package changes...
(1/1) removing libvirt-python3 [###################################] 100%



$ virt-install
ERROR
--name is required
--memory amount in MiB is required
--disk storage must be specified (override with --disk none)
An install method must be specified
(--location URL, --cdrom CD/ISO, --pxe, --import, --boot hd|cdrom|...)
Comment by Konstantin Gizdov (kgizdov) - Thursday, 06 October 2016, 08:17 GMT
Maybe try rebooting to update the virtual environment. I basically spent a day trying to fix this and the only thing that fixed it was to install libvirt-python3
Comment by Konstantin Gizdov (kgizdov) - Thursday, 06 October 2016, 09:56 GMT
EDIT: "PYTHONPATH=/usr/bin/python2 virt-manager" seems to work for now

OK, this is getting annoying. It was all working last night and now I have the same issue with both virt-manager and virt-install:
gizdov@arch ~ virt-manager
Traceback (most recent call last):
File "/usr/share/virt-manager/virt-manager", line 33, in <module>
from virtinst import util as util
File "/usr/share/virt-manager/virtinst/__init__.py", line 39, in <module>
from . import util
File "/usr/share/virt-manager/virtinst/util.py", line 28, in <module>
import libvirt
ImportError: dynamic module does not define init function (initlibvirt)


gizdov@arch ~ virt-install
Traceback (most recent call last):
File "/usr/share/virt-manager/virt-install", line 27, in <module>
import libvirt
ImportError: dynamic module does not define init function (initlibvirt)


gizdov@arch ~ virsh -c qemu:///system
Welcome to virsh, the virtualisation interactive terminal.

Type: 'help' for help with commands
'quit' to quit

virsh # quit

As you can see virtualization is configured and working correctly, but there is some binary mismatch with the python interface. There was an update to libvirt 2.3 as well, not sure if it's related.
Comment by Doug Newgard (Scimmia) - Thursday, 06 October 2016, 13:36 GMT
What is PYTHONPATH normally set to?
Comment by Konstantin Gizdov (kgizdov) - Thursday, 06 October 2016, 13:51 GMT
gizdov@arch ~ echo $PYTHONPATH
:/usr/lib

gizdov@arch ~ which python
/usr/bin/python

gizdov@arch ~ virt-manager
Traceback (most recent call last):
File "/usr/share/virt-manager/virt-manager", line 33, in <module>
from virtinst import util as util
File "/usr/share/virt-manager/virtinst/__init__.py", line 39, in <module>
from . import util
File "/usr/share/virt-manager/virtinst/util.py", line 28, in <module>
import libvirt
ImportError: dynamic module does not define init function (initlibvirt)
Comment by Doug Newgard (Scimmia) - Thursday, 06 October 2016, 13:56 GMT
gizdov@arch ~ echo $PYTHONPATH
:/usr/lib

Yeah, don't do that. Unset it, then fix whatever you've got setting it. This will likely fix your issue.
Comment by Konstantin Gizdov (kgizdov) - Friday, 07 October 2016, 11:44 GMT
You are correct. It was a misconfigured AUR package. Now all works fine. Sorry for the trouble.

Loading...