Virtualization SDK Python path issue on Lion

Aditya

Bit poster
I installed the latest virtualization SDK on Lion & when I tried to use prlsdkapi (python) with Parallels Desktop, I get the following error:

Traceback (most recent call last):
File "test.py", line 7, in <module>
import prlsdkapi
ImportError: No module named prlsdkapi

So I dug in to see where prlsdkapi was installed & found it isn site-packages, which was essentially a symlink to the original location:

lrwxr-xr-x 1 root wheel 135 Sep 6 09:56 prlsdkapi -> ../../../../Library/Parallels/Parallels Service.app/Contents/Frameworks/ParallelsVirtualizationSDK.framework/Libraries/Python/prlsdkapi

But that above path doesn't exist & I finally found the right location for it :

prlsdkapi -> ../../../Frameworks/ParallelsVirtualizationSDK.framework/Libraries/Python/prlsdkapi

But now when I try to rerun my test script, I get the following error:

dlopen(/Library/Python/2.7/site-packages/prlsdkapi/prlsdk.so, 2): no suitable image found. Did find:
/Library/Python/2.7/site-packages/prlsdkapi/prlsdk.so: mach-o, but wrong architecture
Traceback (most recent call last):
File "test.py", line 7, in <module>
import prlsdkapi
File "/Library/Python/2.7/site-packages/prlsdkapi/__init__.py", line 22, in <module>
raise ImportError, err
ImportError: Cannot import module "prlsdk" !

So I'm either referencing the wrong module or the module itself probably is not compatible with Lion. Any suggestions?

--aditya
 
I've run into the same problem, although after installing the SDK, the ...Python/prlsdkapi folders are missing. What version of the SDK did you install? Have you made any progress on this?
 
We apologize for these inconveniences and try to make this info more clear on our site. Good luck and have a good experience with our product intergration.
 
Would it be possible to get an example of how prlsdkapi.VmGuest.run_program is used? I am having trouble particularly with how to deal with handles in Python, such has how to create a new handle to a string.
 
Would it be possible to get an example of how prlsdkapi.VmGuest.run_program is used? I am having trouble particularly with how to deal with handles in Python, such has how to create a new handle to a string.

The documentation is kinda convoluted. The C API reference docs are much better. Essentially, you have to first login to the VM guest. In this case, you have to call the Vm.login_in_guest() method first. And remember this is an asynchronous call so, this should get you the VmGuest object (e.g.):

vm_guest = vm.login_in_guest('user', 'my_awesome_pass').wait().get_param()

Then you can call other VmGuest methods on it.

Edit: Forgot about string handles. Look at StringList object in the API. run_program method takes StringList as values for hArgsList & hEnvsList.
 
Last edited:
Back
Top