virt-lightning / virt-lightning

Starts your VM on libvirt in a couple of seconds!
185 stars 43 forks source link

vl doesn't seem to work with Python 3.10 #261

Closed thalin closed 1 year ago

thalin commented 1 year ago
❯ vl up
Traceback (most recent call last):
  File "/home/thalin/.local/bin/vl", line 8, in <module>
    sys.exit(main())
  File "/home/thalin/.local/lib/python3.10/site-packages/virt_lightning/shell.py", line 378, in main
    action_func(configuration=configuration, **vars(args))
  File "/home/thalin/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 183, in up
    _register_aio_virt_impl(loop)
  File "/home/thalin/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 68, in _register_aio_virt_impl
    libvirtaio.virEventRegisterAsyncIOImpl(loop=loop)
  File "/usr/lib/python3/dist-packages/libvirtaio.py", line 477, in virEventRegisterAsyncIOImpl
    _current_impl = virEventAsyncIOImpl(loop=loop).register()
  File "/usr/lib/python3/dist-packages/libvirtaio.py", line 285, in __init__
    self._finished = asyncio.Event(loop=loop)
  File "/usr/lib/python3.10/asyncio/locks.py", line 168, in __init__
    super().__init__(loop=loop)
  File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in __init__
    raise TypeError(
TypeError: As of 3.10, the *loop* parameter was removed from Event() since it is no longer necessary
goneri commented 1 year ago

Hi @thalin!

This is actually a dup of https://github.com/virt-lightning/virt-lightning/issues/221, the problem comes from the Python binding of libvirt. If you're adventurous, you can edit the file yourself to remove the loop parameter, Or use Python3.9 until your Linux distribution fix the problem :-).