title: Error while installing virt-manager due to versioning issues
body: <p>I was on Linux Mint 19.3 and upgraded to 20 a day ago, and I am now testing all my software to make sure they still work. Virt-manager doesn't work right now (but it does in 19.3), and I am very perplexed as to why. Virsh seems to work fine:</p>
  <pre><code>kelvin@mint-1:/usr/share$ virsh list --all
   Id   Name            State
  --------------------------------
   -    kali            shut off
   -    ubuntu18.04     shut off
   -    ubuntu20.04     shut off
   -    ubuntu20.04.2   shut off
   -    win10           shut off
  </code></pre>
  <p>KVM seems to work fine too:</p>
  <pre><code>kelvin@mint-1:/usr/share$ kvm-ok
  INFO: /dev/kvm exists
  KVM acceleration can be used
  </code></pre>
  <p>Libvirtd seems to be working too:</p>
  <pre><code>kelvin@mint-1:/usr/share$ service libvirtd status
  ● libvirtd.service - Virtualization daemon
       Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
       Active: active (running) since Tue 2020-07-07 11:09:16 EDT; 1h 2min ago
  TriggeredBy: ● libvirtd-ro.socket
               ● libvirtd-admin.socket
               ● libvirtd.socket
         Docs: man:libvirtd(8)
               https://libvirt.org
     Main PID: 16336 (libvirtd)
        Tasks: 25 (limit: 32768)
       Memory: 48.1M
       CGroup: /system.slice/libvirtd.service
               ├─ 1548 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi1.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1549 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi1.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1610 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1613 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1716 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi2.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1717 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi2.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1801 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi3.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               ├─ 1803 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/wifi3.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
               └─16336 /usr/sbin/libvirtd
  
  Jul 07 11:09:16 mint-1 dnsmasq-dhcp[1548]: read /var/lib/libvirt/dnsmasq/wifi1.hostsfile
  Jul 07 11:09:16 mint-1 dnsmasq[1610]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
  Jul 07 11:09:16 mint-1 dnsmasq-dhcp[1610]: read /var/lib/libvirt/dnsmasq/default.hostsfile
  Jul 07 11:09:16 mint-1 dnsmasq[1801]: read /etc/hosts - 12 addresses
  Jul 07 11:09:16 mint-1 dnsmasq[1801]: read /var/lib/libvirt/dnsmasq/wifi3.addnhosts - 0 addresses
  Jul 07 11:09:16 mint-1 dnsmasq-dhcp[1801]: read /var/lib/libvirt/dnsmasq/wifi3.hostsfile
  Jul 07 11:09:16 mint-1 libvirtd[16336]: libvirt version: 6.0.0, package: 0ubuntu8.1 (Christian Ehrhardt &lt;christian.ehrhardt@canonical.com&gt; Wed, 20 May 2020 06:59:57 +0200)
  Jul 07 11:09:16 mint-1 libvirtd[16336]: hostname: mint-1
  Jul 07 11:09:16 mint-1 libvirtd[16336]: ignoring dangling symlink '/home/kelvin/.steampath'
  Jul 07 11:10:51 mint-1 libvirtd[16336]: End of file while reading data: Input/output error
  </code></pre>
  <p>Then I decided to run virt-manager:</p>
  <pre><code>kelvin@mint-1:/usr/share$ virt-manager
  Traceback (most recent call last):
    File &quot;/usr/share/virt-manager/virt-manager&quot;, line 19, in &lt;module&gt;
      from virtinst import BuildConfig
    File &quot;/usr/share/virt-manager/virtinst/__init__.py&quot;, line 49, in &lt;module&gt;
      from virtinst.domain import *  # pylint: disable=wildcard-import
    File &quot;/usr/share/virt-manager/virtinst/domain/__init__.py&quot;, line 5, in &lt;module&gt;
      from .blkiotune import DomainBlkiotune
    File &quot;/usr/share/virt-manager/virtinst/domain/blkiotune.py&quot;, line 8, in &lt;module&gt;
      from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
    File &quot;/usr/share/virt-manager/virtinst/xmlbuilder.py&quot;, line 16, in &lt;module&gt;
      from .xmlapi import XMLAPI
    File &quot;/usr/share/virt-manager/virtinst/xmlapi.py&quot;, line 7, in &lt;module&gt;
      import libxml2
  ModuleNotFoundError: No module named 'libxml2'
  Error in sys.excepthook:
  Traceback (most recent call last):
    File &quot;/usr/lib/python3/dist-packages/apport_python_hook.py&quot;, line 153, in apport_excepthook
      with os.fdopen(os.open(pr_filename,
  FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_virt-manager_virt-manager.1000.crash'
  
  Original exception was:
  Traceback (most recent call last):
    File &quot;/usr/share/virt-manager/virt-manager&quot;, line 19, in &lt;module&gt;
      from virtinst import BuildConfig
    File &quot;/usr/share/virt-manager/virtinst/__init__.py&quot;, line 49, in &lt;module&gt;
      from virtinst.domain import *  # pylint: disable=wildcard-import
    File &quot;/usr/share/virt-manager/virtinst/domain/__init__.py&quot;, line 5, in &lt;module&gt;
      from .blkiotune import DomainBlkiotune
    File &quot;/usr/share/virt-manager/virtinst/domain/blkiotune.py&quot;, line 8, in &lt;module&gt;
      from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
    File &quot;/usr/share/virt-manager/virtinst/xmlbuilder.py&quot;, line 16, in &lt;module&gt;
      from .xmlapi import XMLAPI
    File &quot;/usr/share/virt-manager/virtinst/xmlapi.py&quot;, line 7, in &lt;module&gt;
      import libxml2
  ModuleNotFoundError: No module named 'libxml2'
  </code></pre>
  <p>So the problem is clearly missing <code>libxml2</code> right? I look everywhere, and what I found out is that <code>libxml2</code> is a C library/binary, installed using <code>apt install libxml2</code>, and <code>lxml</code> is a python binding to <code>libxml2</code>, installed using <code>pip3 install lxml</code>. All well and good. But then again, it still outputs that error. So I went into the file <code>/usr/share/virt-manager/virtinst/xmlapi.py</code> and change <code>import libxml2</code> to <code>import lxml as libxml2</code>.</p>
  <p>This approach works great, and virt-manager starts up as usual. But then, I can't connect to QEMU/KVM for some reason, so I decided to delete the connection entirely, and recreate the connection again, still using the default URL <code>qemu:///system</code>. But then, it can't connect, and it dumps this log:</p>
  <pre><code>Unable to connect to libvirt qemu:///system.
  
  'virConnect' object has no attribute 'caps'
  
  Libvirt URI is: qemu:///system
  
  Traceback (most recent call last):
    File &quot;/usr/share/virt-manager/virtManager/connection.py&quot;, line 1033, in _open_thread
      self._populate_initial_state()
    File &quot;/usr/share/virt-manager/virtManager/connection.py&quot;, line 991, in _populate_initial_state
      self.get_uri(), self.caps.get_xml())
    File &quot;/usr/share/virt-manager/virtManager/connection.py&quot;, line 314, in &lt;lambda&gt;
      caps = property(lambda self: getattr(self, &quot;_backend&quot;).caps)
    File &quot;/usr/share/virt-manager/virtinst/connection.py&quot;, line 118, in __getattr__
      return getattr(libvirtconn, attr)
  AttributeError: 'virConnect' object has no attribute 'caps'
  </code></pre>
  <p>This is the point where it throws an error:</p>
  <pre><code>def _populate_initial_state(self):
      log.debug(&quot;libvirt version=%s&quot;,
                    self._backend.local_libvirt_version())
      log.debug(&quot;daemon version=%s&quot;,
                    self._backend.daemon_version())
      log.debug(&quot;conn version=%s&quot;, self._backend.conn_version())
      log.debug(&quot;%s capabilities:\n%s&quot;,
                    self.get_uri(), self.caps.get_xml())
  </code></pre>
  <p>I tried to comment out that section, but it still throws an error at another location. The only definition I can see is this:</p>
  <pre><code>def invalidate_caps(self):
      return self._backend.invalidate_caps()
  caps = property(lambda self: getattr(self, &quot;_backend&quot;).caps)
  </code></pre>
  <p>Right now, I am so deep into this that I feel like I am missing something if I am actually changing the source code. So where was I wrong?</p>