sethmlarson/virtualbox-python

Cannot find VBoxPython module (tried: VBoxPython3_8, VBoxPython3, VBoxPython)

kmille opened this issue · 3 comments

Hey,
I'm using Arch Linux and I think your module does not work with python3.8 (but I don't know why)

kmille@linbox% head vms.py
# -*- coding: utf-8 -*-
from virtualbox.library import MachineState
from virtualbox import VirtualBox

vbox = VirtualBox()


kmille@linbox py3status% python vms.py
m=VBoxPython3_8 x=No module named 'VBoxPython3_8'
m=VBoxPython3 x=No module named 'VBoxPython3'
m=VBoxPython x=No module named 'VBoxPython'
Traceback (most recent call last):
  File "vms.py", line 5, in <module>
    vbox = VirtualBox()
  File "/home/kmille/.local/lib/python3.8/site-packages/virtualbox/library_ext/vbox.py", line 22, in __init__
    manager = virtualbox.Manager()
  File "/home/kmille/.local/lib/python3.8/site-packages/virtualbox/__init__.py", line 145, in __init__
    self.manager = vboxapi.VirtualBoxManager(mtype, mparams)
  File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 989, in __init__
    self.platform = PlatformXPCOM(dPlatformParams)
  File "/usr/lib/python3.8/site-packages/vboxapi/__init__.py", line 750, in __init__
    import xpcom.vboxxpcom
  File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py", line 78, in <module>
    raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),))
Exception: Cannot find VBoxPython module (tried: VBoxPython3_8, VBoxPython3, VBoxPython)


kmille@linbox ~% pip show vboxapi
Name: vboxapi
Version: 1.0
Summary: Python interface to VirtualBox
Home-page: http://www.virtualbox.org
Author: Oracle Corp.
Author-email: vbox-dev@virtualbox.org
License: UNKNOWN
Location: /usr/lib/python3.8/site-packages
Requires: 
Required-by: 
kmille@linbox ~% pacman -Qo /usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py
/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/vboxxpcom.py is owned by virtualbox-sdk 6.0.14-4

kmille@linbox ~% python --version                                                           
Python 3.8.0

I'm not sure what to debug next

See this issue for places to look: #116

Okay - now my initial plan was (like in #116) build virtualbox from scratch and copy the files (VBoxPython.so and VBoxPython3_8m.so) to /usr/lib/virtualbox.

The question is: why are these files not part of the Arch Linux package?
And: there is a virtualbox-sdk package with the following files (https://www.archlinux.de/packages/community/x86_64/virtualbox-sdk):

usr/lib/python3.8/
usr/lib/python3.8/site-packages/
usr/lib/python3.8/site-packages/vboxapi-1.0-py3.8.egg-info
usr/lib/python3.8/site-packages/vboxapi/
usr/lib/python3.8/site-packages/vboxapi/VirtualBox_constants.py
usr/lib/python3.8/site-packages/vboxapi/__init__.py
usr/lib/python3.8/site-packages/vboxapi/__pycache__/
usr/lib/python3.8/site-packages/vboxapi/__pycache__/VirtualBox_constants.cpython-38.pyc
usr/lib/python3.8/site-packages/vboxapi/__pycache__/__init__.cpython-38.pyc

Is this just a different way of exposing the VirtualBox API tu python and your module is not using THIS kind of api? I'm not sure if I understand the probelem here.

Fixed for me on Arch after upgrading to virtualbox 6.1.0-1.
see: https://bugs.archlinux.org/task/64736