[Libguestfs] python 3 bindings on libguestfs

Richard W.M. Jones rjones at redhat.com
Thu Jan 25 15:19:04 UTC 2018


On Thu, Jan 25, 2018 at 03:09:47PM +0000, abinaya.manikandan at wipro.com wrote:
> Hi,
> 
> As per you suggestion I have set PYTHONPATH.
> Now the issue is different.
> 
> [root at euca-172-31-15-221 ~]$ echo $PYTHONPATH
> /opt/libguestfs/x86_64/1.32.10/lib64:/opt/libguestfs/x86_64/1.32.10/lib/python3.6/site-packages/:
> [root at euca-172-31-15-221 ~]$ python
> Python 3.6.0 (default, Jun  1 2017, 02:10:02)
> [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> print(sys.path)
> ['', '/opt/libguestfs/x86_64/1.32.10/lib64', '/opt/libguestfs/x86_64/1.32.10/lib/python3.6/site-packages', '/root', '/opt/python/x86_64/3.6.0-1/lib/python36.zip', '/opt/python/x86_64/3.6.0-1/lib/python3.6', '/opt/python/x86_64/3.6.0-1/lib/python3.6/lib-dynload', '/opt/python/x86_64/3.6.0-1/lib/python3.6/site-packages']
> >>> import guestfs
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/opt/libguestfs/x86_64/1.32.10/lib/python3.6/site-packages/guestfs.py", line 73, in <module>
>     import libguestfsmod
> ModuleNotFoundError: No module named 'libguestfsmod'

I guess you need to find where libguestfsmod* was installed
and add that to the PYTHONPATH as well.

In my python3 install both libraries are in the same directory,
I don't know why it's different for you.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list