Page 1 of 1

Python3 support for VirtualBox API

Posted: 31. May 2018, 16:47
by Costique
I am trying to use the vboxapi module in python3.6. Importing works fine, however, running:

Code: Select all

vboxMgr = vboxapi.VirtualBoxManager(None, None)
will crash with the following output:

Code: Select all

m=VBoxPython3_6m x=No module named 'VBoxPython3_6m'
m=VBoxPython3m x=No module named 'VBoxPython3m'
m=VBoxPython x=No module named 'VBoxPython'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/vboxapi/__init__.py", line 989, in __init__
    self.platform = PlatformXPCOM(dPlatformParams)
  File "/usr/local/lib/python3.6/site-packages/vboxapi/__init__.py", line 750, in __init__
    import xpcom.vboxxpcom
  File "/Applications/VirtualBox.app/Contents/MacOS/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_6m, VBoxPython3m, VBoxPython)
Searching inside /Applications/VirtualBox.app/Contents/MacOS, I can find these two files: VBoxPython2_7.so and VBoxPython2_6.so.
I believe I should also find the corresponding .so files for python 3.6.

I tried linking python to python3.6 or creating an alias python=python3.6 hoping that installing VirtualBox this way would generate the files, but it didn't.

How can I obtain those files?

Re: Python3 support for VirtualBox API

Posted: 31. May 2018, 16:55
by socratis
Costique wrote:I believe I should also find the corresponding .so files for python 3.6.
Not if there no support when building VirtualBox, you won't. I believe that support for Python 3 in a work in progress. Where did you get yours? AFAIK, even 10.13.x comes with Python 2.7.

Moving to "VirtualBox API" from "OSX Hosts".

Re: Python3 support for VirtualBox API

Posted: 6. Feb 2019, 12:36
by nick1
Any news about Python 3 support for OSX?