[libvirt-users] Python Bindings for Python 2.7

Hello, I want to source compile the libvirt 0.8.4 with its Python bindings. I have python 2.4 rpm installed but i dont use it. I use Python 2.7 source compiled version. So when i compile libvirt it produces bindings for Python 2.4 which is obvious choice since it is rpm. So how should i make it point to Python 2.7 so that it produces bindings for it. Installed path of Python 2.7 is /opt/Python2.7. Please Guide me. Thanks Vipul

2011/1/19 vipul borikar <vipulcell@gmail.com>:
Hello, I want to source compile the libvirt 0.8.4 with its Python bindings.
I have python 2.4 rpm installed but i dont use it. I use Python 2.7 source compiled version.
So when i compile libvirt it produces bindings for Python 2.4 which is obvious choice since it is rpm.
So how should i make it point to Python 2.7 so that it produces bindings for it. Installed path of Python 2.7 is /opt/Python2.7.
Please Guide me.
You can try to run ./configure --with-python=/opt/Python2.7 assuming that there is /opt/Python2.7/bin/python. Another possibility is to specify the Python binary per environment variable PYTHON=/opt/Python2.7/bin/python ./configure This will probably work but I'm not entirely sure as this is an uncommon configuration. Matthias

Thanks for the Reply Matthias. The ./configure --with-python=/opt/Python2.7 worked. But when i do make I go this error related with sax parser. make[3]: Entering directory `/root/libvirt-0.8.4/python' /opt/Python-2.7//bin/python ./generator.py . Traceback (most recent call last): File "./generator.py", line 1447, in <module> if buildStubs() < 0: File "./generator.py", line 567, in buildStubs (parser, target) = getparser() File "./generator.py", line 35, in getparser parser = xml.sax.make_parser() File "/opt/Python-2.7/lib/python2.7/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser return XMLParserFactory.make_parser(parser_list) File "/opt/Python-2.7/lib/python2.7/site-packages/_xmlplus/sax/saxexts.py", line 75, in make_parser sys.modules[parser_name].create_parser = _create_parser KeyError: 'xml.sax.drivers2.drv_pyexpat' make[3]: *** [generated.stamp] Error 1 make[3]: Leaving directory `/root/libvirt-0.8.4/python' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/libvirt-0.8.4/python' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/libvirt-0.8.4' make: *** [all] Error 2 Thanks Vipul On Wed, Jan 19, 2011 at 6:25 PM, Matthias Bolte < matthias.bolte@googlemail.com> wrote:
Hello, I want to source compile the libvirt 0.8.4 with its Python bindings.
I have python 2.4 rpm installed but i dont use it. I use Python 2.7
2011/1/19 vipul borikar <vipulcell@gmail.com>: source
compiled version.
So when i compile libvirt it produces bindings for Python 2.4 which is obvious choice since it is rpm.
So how should i make it point to Python 2.7 so that it produces bindings for it. Installed path of Python 2.7 is /opt/Python2.7.
Please Guide me.
You can try to run
./configure --with-python=/opt/Python2.7
assuming that there is /opt/Python2.7/bin/python.
Another possibility is to specify the Python binary per environment variable
PYTHON=/opt/Python2.7/bin/python ./configure
This will probably work but I'm not entirely sure as this is an uncommon configuration.
Matthias

On Thu, Jan 20, 2011 at 10:59:40AM +0530, vipul borikar wrote:
Thanks for the Reply Matthias.
The ./configure --with-python=/opt/Python2.7 worked.
But when i do make I go this error related with sax parser.
make[3]: Entering directory `/root/libvirt-0.8.4/python' /opt/Python-2.7//bin/python ./generator.py . Traceback (most recent call last): File "./generator.py", line 1447, in <module> if buildStubs() < 0: File "./generator.py", line 567, in buildStubs (parser, target) = getparser() File "./generator.py", line 35, in getparser parser = xml.sax.make_parser() File "/opt/Python-2.7/lib/python2.7/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser return XMLParserFactory.make_parser(parser_list) File "/opt/Python-2.7/lib/python2.7/site-packages/_xmlplus/sax/saxexts.py", line 75, in make_parser sys.modules[parser_name].create_parser = _create_parser [...]
I have python 2.4 rpm installed but i dont use it. I use Python 2.7 source compiled version.
seems your hand compiled version of python has a problem and lacks XML/expat support. Unrelated to libvirt, Fedora uses Python 2.7 and I have no problem with it. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel Veillard
-
Matthias Bolte
-
vipul borikar