Python3 support for VirtualBox API

Discussion about using the VirtualBox API, Tutorials, Samples.

Python3 support for VirtualBox API

Postby Costique » 31. May 2018, 16:47

I am trying to use the vboxapi module in python3.6. Importing works fine, however, running:
Code: Select all   Expand viewCollapse view
vboxMgr = vboxapi.VirtualBoxManager(None, None)

will crash with the following output:
Code: Select all   Expand viewCollapse view
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?
Costique
 
Posts: 1
Joined: 31. May 2018, 16:40

Re: Python3 support for VirtualBox API

Postby socratis » 31. May 2018, 16:55

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".
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 25224
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Python3 support for VirtualBox API

Postby nick1 » 6. Feb 2019, 12:36

Any news about Python 3 support for OSX?
nick1
 
Posts: 1
Joined: 6. Feb 2019, 12:35


Return to The VirtualBox API

Who is online

Users browsing this forum: No registered users and 1 guest