Python3 support for VirtualBox API

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
Costique
Posts: 1
Joined: 31. May 2018, 16:40

Python3 support for VirtualBox API

Post 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?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Python3 support for VirtualBox API

Post 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".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
nick1
Posts: 1
Joined: 6. Feb 2019, 12:35

Re: Python3 support for VirtualBox API

Post by nick1 »

Any news about Python 3 support for OSX?
Post Reply