Issue with python pip install
I am trying to build a Python application installer that is using libguestfs. I using the instructions to create the python package posted at https://github.com/libguestfs/libguestfs/commit/fcbfc4775fa2a44020974073594a... I am getting errors in the compile when I do the "pip install”. I have attached the output from pip. I looked at the code and I do not see anything obvious) When I do a yum install of python-libguestds.x86_64 the python interface works correctly. Version/Platform Information Platform: Centos-7 libguestfs version: 1.31..6 $ uname -a Linux localhost.localdomain 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux $ gcc --version gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ python --version Python 2.7.5 Any help or suggestions would be appreciated. Regards John
On Mon, Sep 14, 2015 at 05:48:24PM +0000, John McDowall wrote:
I am trying to build a Python application installer that is using libguestfs. I using the instructions to create the python package posted at
https://github.com/libguestfs/libguestfs/commit/fcbfc4775fa2a44020974073594a...
I am getting errors in the compile when I do the "pip install”. I have attached the output from pip. I looked at the code and I do not see anything obvious)
When I do a yum install of python-libguestds.x86_64 the python interface works correctly.
Version/Platform Information
Platform: Centos-7
libguestfs version: 1.31..6
$ uname -a Linux localhost.localdomain 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python --version Python 2.7.5
Any help or suggestions would be appreciated.
I think what is happening is that you've got an older version of libguestfs installed than the one you're building the python bindings for. Because libguestfs (eg. git) contains its own python bindings, the assumption has always been that the version of libguestfs will be exactly the same (ie. all APIs will be present and identical). If you build different versions, then that's no longer true, so you see errors from "missing" APIs (ie. ones not present in your old version of libguestfs). eg: build/temp.linux-x86_64-2.7/guestfs-py.o guestfs-py.c:310:26: warning: ‘struct guestfs_btrfsbalance’ declared inside parameter list [enabled by default] put_btrfsbalance (struct guestfs_btrfsbalance *btrfsbalance) ^ This could be fixed, but needs patching in generator/python.ml upstream. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Richard, Thanks for fast reply - let me remove all the yum packages and then build/install from single version. Regards John On 9/14/15, 11:06 AM, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Mon, Sep 14, 2015 at 05:48:24PM +0000, John McDowall wrote:
I am trying to build a Python application installer that is using libguestfs. I using the instructions to create the python package posted at
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_libguestf s_libguestfs_commit_fcbfc4775fa2a44020974073594a745ca420d614&d=AwIDaQ&c=V 9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1ED54jEjvA E36A8TVJroVlrOQ&m=-IPoTUqv9RwNuzcUMbulN09BL2qUyaVp0CawpFWfDR0&s=OTJvFjRpY gKWny-76DVZKbuv88vwDejfMPl7J6-A4WI&e=
I am getting errors in the compile when I do the "pip install². I have attached the output from pip. I looked at the code and I do not see anything obvious)
When I do a yum install of python-libguestds.x86_64 the python interface works correctly.
Version/Platform Information
Platform: Centos-7
libguestfs version: 1.31..6
$ uname -a Linux localhost.localdomain 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python --version Python 2.7.5
Any help or suggestions would be appreciated.
I think what is happening is that you've got an older version of libguestfs installed than the one you're building the python bindings for.
Because libguestfs (eg. git) contains its own python bindings, the assumption has always been that the version of libguestfs will be exactly the same (ie. all APIs will be present and identical).
If you build different versions, then that's no longer true, so you see errors from "missing" APIs (ie. ones not present in your old version of libguestfs). eg:
build/temp.linux-x86_64-2.7/guestfs-py.o guestfs-py.c:310:26: warning: Œstruct guestfs_btrfsbalance¹ declared inside parameter list [enabled by default] put_btrfsbalance (struct guestfs_btrfsbalance *btrfsbalance) ^
This could be fixed, but needs patching in generator/python.ml upstream.
Rich.
-- Richard Jones, Virtualization Group, Red Hat https://urldefense.proofpoint.com/v2/url?u=http-3A__people.redhat.com_-7Er jones&d=AwIDaQ&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDp fOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=-IPoTUqv9RwNuzcUMbulN09BL2qUyaVp0CawpFW fDR0&s=Mmb07TGz8PFUIgbQkVudoe7WLhvStKfkBlMU_xywPrg&e= Read my programming and virtualization blog: https://urldefense.proofpoint.com/v2/url?u=http-3A__rwmj.wordpress.com&d=A wIDaQ&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1E D54jEjvAE36A8TVJroVlrOQ&m=-IPoTUqv9RwNuzcUMbulN09BL2qUyaVp0CawpFWfDR0&s=5u dxKIkjvN0DUi5xvC1UlkztyjoKLwFYv3R-q1vvshg&e= libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. https://urldefense.proofpoint.com/v2/url?u=http-3A__libguestfs.org&d=AwIDa Q&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1ED54j EjvAE36A8TVJroVlrOQ&m=-IPoTUqv9RwNuzcUMbulN09BL2qUyaVp0CawpFWfDR0&s=isOT9Q sPnKPgVpatbcO42QTgPVh1Fo_5XH0bj5-thnE&e=
On Mon, Sep 14, 2015 at 06:12:27PM +0000, John McDowall wrote:
Richard,
Thanks for fast reply - let me remove all the yum packages and then build/install from single version.
I would avoid using 'make install' in the libguestfs git repo. A better plan may be to roll back the git repo to match the version of libguestfs you have installed (from yum), eg: git reset --hard 1.28.1 then try the pip method again. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard, It is looking better, but still getting error - see attached log. I removed all installed packages and yum installed libguestfs libguestfs-devel (1.28.1) Then reset my git repository to 1.28.1 and then $ make clean $ ./autogen.sh --disable-erlang --disable-perl --disable-lua --disable-ruby $ make $ make -C python sdist $ cd python/dist $ sudo pip install guestfs-1.28.1.tar.gz Regards John On 9/14/15, 11:21 AM, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Mon, Sep 14, 2015 at 06:12:27PM +0000, John McDowall wrote:
Richard,
Thanks for fast reply - let me remove all the yum packages and then build/install from single version.
I would avoid using 'make install' in the libguestfs git repo.
A better plan may be to roll back the git repo to match the version of libguestfs you have installed (from yum), eg:
git reset --hard 1.28.1
then try the pip method again.
Rich.
-- Richard Jones, Virtualization Group, Red Hat https://urldefense.proofpoint.com/v2/url?u=http-3A__people.redhat.com_-7Er jones&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDp fOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=o-TnLIVCsJ3aeiNcH_Pu4yVo1sdqyhS5aUHdruT NAhg&s=H9YY91eaSkCTCMy0IMxhVJSgHGRhalqQl7JmSviqFYI&e= Read my programming and virtualization blog: https://urldefense.proofpoint.com/v2/url?u=http-3A__rwmj.wordpress.com&d=A wIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1E D54jEjvAE36A8TVJroVlrOQ&m=o-TnLIVCsJ3aeiNcH_Pu4yVo1sdqyhS5aUHdruTNAhg&s=ht vTMCbT7-QnAHxD7J0rMtD3ZdT2CjIeV3J7adPZ9EY&e= Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. https://urldefense.proofpoint.com/v2/url?u=http-3A__fedoraproject.org_wiki _MinGW&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavD pfOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=o-TnLIVCsJ3aeiNcH_Pu4yVo1sdqyhS5aUHdru TNAhg&s=QYagh0fwCEBmiPVHeekIosN2hGlY3YKy24Y4rJ8juwI&e= ./autogen.sh --disable-erlang --disable-perl --disable-lua --disable-ruby
On Mon, Sep 14, 2015 at 07:06:48PM +0000, John McDowall wrote:
Richard,
It is looking better, but still getting error - see attached log.
I removed all installed packages and yum installed libguestfs libguestfs-devel (1.28.1)
Then reset my git repository to 1.28.1 and then
$ make clean $ ./autogen.sh --disable-erlang --disable-perl --disable-lua --disable-ruby $ make $ make -C python sdist $ cd python/dist $ sudo pip install guestfs-1.28.1.tar.gz
That's pretty close to working. We remove the *_9p functions in RHEL because they are not supportable, so if you edit guestfs-py.c by hand to remove those bindings it may work. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Richard, I put an #ifdef around the logic in py_guestfs_mount_9p and py_guestfs_list_9p, I.e. Left the signatures but the functions just return a a NULL PyObject. It now builds and installs with pip. Thanks for all your help most appreciated. Is there a better way to do this?, #ifdefs always seem a little hacky. Regards John On 9/14/15, 12:47 PM, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Mon, Sep 14, 2015 at 07:06:48PM +0000, John McDowall wrote:
Richard,
It is looking better, but still getting error - see attached log.
I removed all installed packages and yum installed libguestfs libguestfs-devel (1.28.1)
Then reset my git repository to 1.28.1 and then
$ make clean $ ./autogen.sh --disable-erlang --disable-perl --disable-lua --disable-ruby $ make $ make -C python sdist $ cd python/dist $ sudo pip install guestfs-1.28.1.tar.gz
That's pretty close to working. We remove the *_9p functions in RHEL because they are not supportable, so if you edit guestfs-py.c by hand to remove those bindings it may work.
Rich.
-- Richard Jones, Virtualization Group, Red Hat https://urldefense.proofpoint.com/v2/url?u=http-3A__people.redhat.com_-7Er jones&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDp fOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=rMKmgqBnzomK9gZ2IFeCMAUQoOb0CIXOuHL0unS akbw&s=Wd1vKCyHdDlv2mC5G5ESdLBSfiHAPPD971EH870rIBc&e= Read my programming and virtualization blog: https://urldefense.proofpoint.com/v2/url?u=http-3A__rwmj.wordpress.com&d=A wIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1E D54jEjvAE36A8TVJroVlrOQ&m=rMKmgqBnzomK9gZ2IFeCMAUQoOb0CIXOuHL0unSakbw&s=FN 5LMvtC9ufnfnGV0YnkBv3OzG8wO768Y9b4VgxJ6W0&e= Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. https://urldefense.proofpoint.com/v2/url?u=http-3A__fedoraproject.org_wiki _MinGW&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavD pfOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=rMKmgqBnzomK9gZ2IFeCMAUQoOb0CIXOuHL0un Sakbw&s=B4XzrgRkrzOTaaxSxzhN0kt7_cwxFKtIPsRdaEualL0&e=
On Mon, Sep 14, 2015 at 09:45:16PM +0000, John McDowall wrote:
Richard,
I put an #ifdef around the logic in py_guestfs_mount_9p and py_guestfs_list_9p, I.e. Left the signatures but the functions just return a a NULL PyObject. It now builds and installs with pip. Thanks for all your help most appreciated.
Is there a better way to do this?, #ifdefs always seem a little hacky.
Actually I was wondering why the python-libguestfs package from RHEL doesn't work for you. I don't use Python much myself, but is there some benefit to using PIP? In answer to your question, yes the #ifdefs are hacky. We need to fix the bug I mentioned before properly. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard, The Redhat yum package works for global settings. Just in the habit of using Python virtual environments, keeps python packages separate and easier to track which packages are required in by an application. Regards John On 9/14/15, 3:08 PM, "Richard W.M. Jones" <rjones@redhat.com> wrote:
On Mon, Sep 14, 2015 at 09:45:16PM +0000, John McDowall wrote:
Richard,
I put an #ifdef around the logic in py_guestfs_mount_9p and py_guestfs_list_9p, I.e. Left the signatures but the functions just return a a NULL PyObject. It now builds and installs with pip. Thanks for all your help most appreciated.
Is there a better way to do this?, #ifdefs always seem a little hacky.
Actually I was wondering why the python-libguestfs package from RHEL doesn't work for you. I don't use Python much myself, but is there some benefit to using PIP?
In answer to your question, yes the #ifdefs are hacky. We need to fix the bug I mentioned before properly.
Rich.
-- Richard Jones, Virtualization Group, Red Hat https://urldefense.proofpoint.com/v2/url?u=http-3A__people.redhat.com_-7Er jones&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDp fOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=ySvUEe1JrJiYtWMPHeBxoFT3Fy5n6Y7C6VLhA5q T-oI&s=otrOnAZCkauO1XDBmknezc4ZTBEpL1FJDhvbsqFLfqc&e= Read my programming and virtualization blog: https://urldefense.proofpoint.com/v2/url?u=http-3A__rwmj.wordpress.com&d=A wIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ6VUDaavDpfOdPQrz1E D54jEjvAE36A8TVJroVlrOQ&m=ySvUEe1JrJiYtWMPHeBxoFT3Fy5n6Y7C6VLhA5qT-oI&s=n5 pPDk_xnoFvA6LrNUUrV_2BsKpoh6jeAlfxneTB-gw&e= virt-builder quickly builds VMs from scratch https://urldefense.proofpoint.com/v2/url?u=http-3A__libguestfs.org_virt-2D builder.1.html&d=AwIBAg&c=V9IgWpI5PvzTw83UyHGVSoW3Uc1MFWe5J8PTfkrzVSo&r=vZ 6VUDaavDpfOdPQrz1ED54jEjvAE36A8TVJroVlrOQ&m=ySvUEe1JrJiYtWMPHeBxoFT3Fy5n6Y 7C6VLhA5qT-oI&s=2YvdPNHgyitmaZNAbYnIUVrrpAwtsARK4G-hZ4jwNwI&e=
On Mon, Sep 14, 2015 at 07:06:27PM +0100, Richard W.M. Jones wrote:
I think what is happening is that you've got an older version of libguestfs installed than the one you're building the python bindings for.
Because libguestfs (eg. git) contains its own python bindings, the assumption has always been that the version of libguestfs will be exactly the same (ie. all APIs will be present and identical).
If you build different versions, then that's no longer true, so you see errors from "missing" APIs (ie. ones not present in your old version of libguestfs). eg:
build/temp.linux-x86_64-2.7/guestfs-py.o guestfs-py.c:310:26: warning: ‘struct guestfs_btrfsbalance’ declared inside parameter list [enabled by default] put_btrfsbalance (struct guestfs_btrfsbalance *btrfsbalance) ^
This could be fixed, but needs patching in generator/python.ml upstream.
I tried to have a go at solving this, but it's not as easy as it seems. So I punted it and filed a bug instead: https://bugzilla.redhat.com/show_bug.cgi?id=1262983 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (2)
-
John McDowall -
Richard W.M. Jones