Hi,
We are trying to build libguestfs RPM package using SPEC file.
As we discussed earlier to enable python bindings on libguestfs need to use ./run python
but this cannot be add in SPEC file.
What we have done to enable python3 in libguestfs is below:
1. We have installed python-3.6.1
2. Enable python using --enable-python in %build section like below
"%configure --disable-appliance --disable-daemon --without-libvirt
--with-qemu="qemu-kvm qemu-system-x86_64 qemu" --prefix=%{_prefix}
--enable-python"
3. Now we could see below files when we installed libguestfs-1.32.10
[root@euca-172-31-15-221 1.32.10]$ ls *
bin:
guestfish virt-copy-in virt-diff virt-index-validate virt-rescue
virt-tar-out
libguestfs-test-tool virt-copy-out virt-edit virt-inspector virt-resize
virt-v2v
virt-alignment-scan virt-customize virt-filesystems virt-log virt-sparsify
virt-v2v-copy-to-local
virt-builder virt-df virt-format virt-ls virt-sysprep
virt-cat virt-dib virt-get-kernel virt-make-fs virt-tar-in
deps:
bin include lib share
doc:
README
etc:
libguestfs-tools.conf virt-builder xdg
include:
guestfs-gobject guestfs-gobject.h guestfs.h
interface:
man startup
lib:
appliance libguestfs-gobject-1.0.so.0 libguestfs_jni.so.1.32.10
pkgconfig
libguestfs.a libguestfs-gobject-1.0.so.0.0.0 libguestfs.la
python3.6
libguestfs-gobject-1.0.a libguestfs_jni.la libguestfs.so
libguestfs-gobject-1.0.la libguestfs_jni.so libguestfs.so.0
libguestfs-gobject-1.0.so libguestfs_jni.so.1 libguestfs.so.0.458.0
lib64:
guestfs stublibs
man:
man1 man3 man5
seehelp:
libguestfs-1.32.10-2.el6.html
share:
doc gtk-doc java javadoc locale
4. We could see python-guestfs libraries in below path,
[root@euca-172-31-15-221 site-packages]$ pwd
/opt/libguestfs/x86_64/1.32.10/lib/python3.6/site-packages
[root@euca-172-31-15-221 site-packages]$ ls
guestfs.py guestfs.pyc guestfs.pyo
We are able to import guestfs without any issue like below:
[root@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 guestfs
>>
But the issue is when we use "GuestFS" attribute like below:
>> guestfs.GuestFS()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'guestfs' has no attribute 'GuestFS'
I have tried a lot to fix the issue and also google the same but no luck.
Please help me on this.
Regards,
Abinaya
-----Original Message-----
From: Richard W.M. Jones [mailto:rjones@redhat.com]
Sent: Thursday, January 25, 2018 4:00 PM
To: Abinaya Sandhiya Manikandan (GIS) <abinaya.manikandan(a)wipro.com>
Cc: libguestfs(a)redhat.com
Subject: Re: [Libguestfs] python 3 bindings on libguestfs
** This mail has been sent from an external source **
On Thu, Jan 25, 2018 at 10:25:16AM +0000, abinaya.manikandan(a)wipro.com wrote:
Hi,
Can you please let me know which all are the python versions
(2.7/3.5/3.6) can enable in libguestfs_v13210.
Any version of Python can be used.
See also:
https://clicktime.symantec.com/a/1/qoKbsFMihHOWmj0p8BcJBr-MlL9BJTkzfYTr3k...
Rich.
--
Richard Jones, Virtualization Group, Red Hat
https://clicktime.symantec.com/a/1/pbXqVcQ3uEu6v0LMydvgvXy-NzoLXRVDjzq6Oo...
Read my programming and virtualization blog:
https://clicktime.symantec.com/a/1/386BbeBDj6ORryrimb0ZrwnXSrDL_6VkuIhbcd...
libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many
languages.
https://clicktime.symantec.com/a/1/lxebQpCMO8fleDAyctDBuYzs51nL60SFwG1hff...
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit
http://www.symanteccloud.com
______________________________________________________________________
The information contained in this electronic message and any attachments to this message
are intended for the exclusive use of the addressee(s) and may contain proprietary,
confidential or privileged information. If you are not the intended recipient, you should
not disseminate, distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments. WARNING: Computer viruses can be
transmitted via email. The recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage caused by any virus
transmitted by this email.
www.wipro.com
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit
http://www.symanteccloud.com
______________________________________________________________________