<div dir="ltr">@Michel<div>using virtualenv we can create an isolated environment in the system.</div><div>Just go through - <a href="http://docs.python-guide.org/en/latest/dev/virtualenvs/">http://docs.python-guide.org/en/latest/dev/virtualenvs/</a><br>
</div><div>@Eric</div><div>I'm using Ubuntu, and I was able to install and use libvirt using sudo apt-get install python-libvirt but its not available in tg2 virtual environment.</div><div><br></div><div>Moreover if you try to install in the virtualenv using the sudo apt-get install python-libvirt, it would say  the package is been already installed.</div>
<div><br></div><div><br></div><div><br></div><div> </div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 6:51 PM, Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 03/05/2014 05:34 AM, Sijo Jose wrote:<br>
> Hi,<br>
> Could you guide me to install libvirt in a virtual environment..?<br>
> OR<br>
> How python-libvirt could be used within a virtual environment after<br>
> installing it, in the system.<br>
<br>
</div></div>Same way as in a non-virtual system.  For example, if your virtual<br>
environment is using Fedora, then 'yum install libvirt-client<br>
libvirt-python', then using it is as simple as:<br>
<br>
$ python<br>
>>> import libvirt<br>
>>> conn = libvirt.open("...")<br>
... use conn<br>
<br>
where the URI you pass to libvirt.open is whatever needed to connect to<br>
the machine where your guests are running, such as "qemu://host/system".<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Eric Blake   eblake redhat com    +1-919-301-3266<br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</font></span></blockquote></div><br></div>