#1116124 virt-manager scripts use #!/usr/bin/env python shebang

#1116124#5
Date:
2025-09-24 02:45:43 UTC
From:
To:
I'm testing Ansible collections with a Molecule scenario that creates
libvirt managed KVM VMs. In order to test against the most recent
versions of Python, Ansible, Molecule, and the collection plugins I
create virtualenvs using pyenv managed Python installations.

The community.libvirt.virt_install module invokes the system
virt-install convenience script. When the pyenv / virtualenv managed
python is active, the virt-install script uses it instead of the system
python resulting in the error below.

Traceback (most recent call last):
  File "/usr/bin/virt-install", line 6, in <module>
    from virtinst import virtinstall
  File "/usr/share/virt-manager/virtinst/__init__.py", line 50, in <module>
    from virtinst.domain import *  # pylint: disable=wildcard-import
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtinst/domain/__init__.py", line 5, in <module>
    from .blkiotune import DomainBlkiotune
  File "/usr/share/virt-manager/virtinst/domain/blkiotune.py", line 8, in <module>
    from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 16, in <module>
    from .xmlapi import XMLAPI
  File "/usr/share/virt-manager/virtinst/xmlapi.py", line 7, in <module>
    import libxml2
ModuleNotFoundError: No module named 'libxml2'


The Debian Python Policy specifically recommends using the full path to
the system python for this reason.

https://www.debian.org/doc/packaging-manuals/python-policy/#interpreter-location

#1116124#10
Date:
2026-08-07 05:28:49 UTC
From:
To:
Hello,

Bug #1116124 in virt-manager reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/libvirt-team/virt-manager/-/commit/8112f16c648ad7309f0c6a7e796f864314ad4d92
------------------------------------------------------------------------
d/rules: drop dh_python3 override, so the default behaviour fixes shebangs

Closes: #1116124
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1116124

#1116124#15
Date:
2026-08-07 06:33:47 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
virt-manager, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1116124@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Pino Toscano <pino@debian.org> (supplier of updated virt-manager package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 07 Aug 2026 08:09:14 +0200
Source: virt-manager
Architecture: source
Version: 1:5.1.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
Changed-By: Pino Toscano <pino@debian.org>
Closes: 1116124 1126867 1129529 1141028
Changes:
 virt-manager (1:5.1.0-2) unstable; urgency=medium
 .
   * d/patches: backport changes for compatibility with pytest 9
     (Closes: #1141028)
   * Remove redundant Priority: optional from source stanza.
   * Update standards version to 4.7.4, no changes needed.
   * d/watch: switch to v5
   * d/control: drop Rules-Requires-Root, no more needed since Debian trixie
   * Bump the debhelper compatibility to 14:
     - bump the debhelper-compat build dependency to 14
     - drop the ${python3:Depends}, and ${misc:Depends} substvars
   * d/control: add the cpio dependency to virt-install (Closes: #1129529)
   * d/rules: drop dh_python3 override, so the default behaviour fixes shebangs
     (Closes: #1116124)
   * d/control: add the libvirt-daemon dependency to virt-install
     (Closes: #1126867)
Checksums-Sha1:
 6f92953e4743533c68630ddae76ca611e5622892 2855 virt-manager_5.1.0-2.dsc
 1d006135f39934f5d8e7f64184c3cfaf6f3babd4 27024 virt-manager_5.1.0-2.debian.tar.xz
 ef7aa66b3965c2bac261166d76e61f4e1c67d110 11239 virt-manager_5.1.0-2_source.buildinfo
Checksums-Sha256:
 4b3c25a1e559cd609f9f2512c5139bae3fd6548166797d7136b62bddb66c8884 2855 virt-manager_5.1.0-2.dsc
 b357611a3cfac308f905d84707da3dc14083528a5622889cfc9e5f405fa5ff1a 27024 virt-manager_5.1.0-2.debian.tar.xz
 0884e90a6ebddd88462c75e04a25837b384d857cb783da1d7b49b7475639fde2 11239 virt-manager_5.1.0-2_source.buildinfo
Files:
 32937ef3872d7c3f4bffbac5642e7f12 2855 admin optional virt-manager_5.1.0-2.dsc
 3da6991b21e66a82202f85161da6cab3 27024 admin optional virt-manager_5.1.0-2.debian.tar.xz
 c11b19df2b06454b1ce60602635ae8ca 11239 admin optional virt-manager_5.1.0-2_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEXyqfuC+mweEHcAcHLRkciEOxP00FAmp1drUACgkQLRkciEOx
P00Wsg//QyLROab8jkpI4H54f1p1RihDd9jN0+3MR/E1GcRAq4FfXNc/rKoGWl0E
gVhgVKGliJjeKoiDczlJMfMrrS4rTUwAiO7TIBraEfihzTnIey9+1i39eQsMdn82
HXLu9sQWKJXh4d3oWDtk0gCWKgm/As1UzQ3+YliRe0z6P/wdXgYQ/3PUu4E1k6r9
2jYbiVbfhPAdZIHNGvP1S4qlGa5XGod0pPyGotoj+8asmvSnMahGaSsAoPMrh50h
Dchx+HVMhnEYcbVLJulbhaoa7eCJq7iGlU58ggnbpgDtHSf6YL5QC0rNZNdqv0G0
Qg6/KETF9/1Mj3aroxneaKUOmi/cnyZX3AG3uphpP391pq5tHuCXQiKyHrXClGsI
SY1wMtTpgUSZjMWO7lAE+u4+PzssGClRaBfQ2jyFvKdTMm+it/fmsu6rG1pfNzDv
hMFMHkOcqTjFO7eQuDy8WB1BNEuJS29sFfwqDEsTOnzPLMWCJv6Vk2hp0opl0q6J
GmzOvPdkk2nXzCdd1GbbCQB8hk0SlDYAPy1FADBT/a8v5nxIR+4mEmldZrz4ePJL
sOOjdLZZ9VPID5BlubsA1y2YElmckb0ieDbONz76lPLs8Kdwq7vIynYUsUOOirIB
WcW5w4kc037NKgSSKpva6OC5QE7jtFFtijkFhw/iKUl5njqSd7w=
=6yB8
-----END PGP SIGNATURE-----