Thank you Daniel! So setting up the PYTHONPATH variable did the trick! Although the simple test executes, but with an interesting error complaining about an undefined symbol in libvirtmod.so<br><span style="background-color: rgb(255, 255, 204);">
<br><span style="background-color: rgb(255, 255, 255);">[root@lcgctb9 libvirt]# python testLibvirt.py</span></span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">Traceback (most recent call last):
</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> File "testLibvirt.py", line 1, in ?</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);">
import libvirt</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255);"> File "/usr/local/lib/python2.3/site-packages/libvirt.py", line 7, in ?</span><br style="background-color: rgb(255, 255, 255);">
<span style="background-color: rgb(255, 255, 255);"> import libvirtmod</span><br style="background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255); font-weight: bold; font-style: italic;">
ImportError: /usr/local/lib/python2.3/site-packages/libvirtmod.so: undefined symbol: PyEval_ThreadsInitialized</span><br style="background-color: rgb(255, 255, 204);"><span style="background-color: rgb(255, 255, 204);"></span>
<br> Regards<br>Omer<br><br><div><span class="gmail_quote">On 12/19/06, <b class="gmail_sendername">Daniel P. Berrange</b> <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Dec 19, 2006 at 04:03:43PM +0100, Omer Khalid wrote:<br>> Hi,<br>><br>> I am still unable to run my simple libvirt test!<br>><br>> I checked out the code from libvirt cvs and following the instructions till
<br>> 'make install'. It all went well. So then I ran my simply python test, as<br>> shown here (<a href="http://www.libvirt.org/python.html">http://www.libvirt.org/python.html</a>). It keeps on giving me the
<br>> following error.<br>><br>> [root@lcgctb9 libvirt]# python testLibvirt.py<br>> Traceback (most recent call last):<br>> File "testLibvirt.py", line 1, in ?<br>> import virt<br>> ImportError: No module named virt
<br><br>The python modiule is called 'libvirt' not 'virt'.<br><br>><br>> I have verified that the library is linked by the following:<br>><br>> [root@lcgctb9 libvirt]# pkg-config libvirt --libs
<br>> -L/usr/local/lib -lvirt -lxenstore<br>><br>> [root@lcgctb9 libvirt]# pkg-config --variable=prefix libvirt<br>> /usr/local<br><br>Since you installed into /usr/local, I suspect you'll need to also set
<br>PYTHONPATH environment variable to tell python to look there for modules<br>it loads. eg export PYTHONPATH=/usr/local/lib/python2.4/site-packages<br><br>Dan.<br>--<br>|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
<br>|=- Perl modules: <a href="http://search.cpan.org/~danberr/">http://search.cpan.org/~danberr/</a> -=|<br>|=- Projects: <a href="http://freshmeat.net/~danielpb/">http://freshmeat.net/~danielpb/
</a> -=|<br>|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|<br></blockquote></div><br><br clear="all"><br>-- <br>---------------------------------------------------------------<br>
<br>CERN – European Organization for Nuclear Research<br>Information Technology Department<br>CH-1211 Geneva 23 <br><br>Phone: +41 (0) 22 767 7996
<br>Fax: +41 (0) 22 767 4900<br>E-mail : <a href="mailto:Omer.Khalid@cern.ch">Omer.Khalid@cern.ch</a><br>Homepage: <a href="http://cern.ch/Omer.Khalid">http://cern.ch/Omer.Khalid</a>