sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

ImportError: No module named 'xpcom' #104

Closed blakem17 closed 6 years ago

blakem17 commented 6 years ago
ENVIRONMENT
SUMMARY

Cannot initialize a new instance of virtualbox. This was working with Windows but is now failing on linux.

STEPS TO REPRODUCE

vbox = virtualbox.VirtualBox(

EXPECTED RESULTS

xpcom to run

ACTUAL RESULTS

thon3 SiteUpdater.py Traceback (most recent call last): File "SiteUpdater.py", line 1, in from getInfo import * File "/media/blake/shared/PythonVBoxController/PythonVBoxController/getInfo.py", line 13, in vbox = virtualbox.VirtualBox() File "/usr/local/lib/python3.5/dist-packages/virtualbox/library_ext/vbox.py", line 22, in init manager = virtualbox.Manager() File "/usr/local/lib/python3.5/dist-packages/virtualbox/init.py", line 137, in init self.manager = vboxapi.VirtualBoxManager(mtype, mparams) File "/usr/local/lib/python3.5/dist-packages/vboxapi/init.py", line 989, in init self.platform = PlatformXPCOM(dPlatformParams) File "/usr/local/lib/python3.5/dist-packages/vboxapi/init.py", line 750, in init import xpcom.vboxxpcom ImportError: No module named 'xpcom'

sethmlarson commented 6 years ago

Have you downloaded and installed the VirtualBox SDK from the virtualbox.org? If you have, what steps did you take to install it?

blakem17 commented 6 years ago

Figured it out. It was an issue with the VBOX SDK install https://forums.virtualbox.org/viewtopic.php?f=7&t=47712

Downloaded and extracted the sdk. Added the environment variables. VBOX_INSTALL_PATH=/usr/lib/virtualbox VBOX_SDK_PATH=/usr/lib/virtualbox/sdk //the directory were I extract the sdk :-) PYTHONPATH=/usr/lib/virtualbox/sdk/bindings/xpcom/python

CD into the sdk/install directory ran sudo python3 vboxapisetup.py install

Now the script is running fine. Thanks for pointing me in the right direction, Feel free to close =D

sethmlarson commented 6 years ago

I'm glad you were able to figure this out! :)