O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

To install the Python libvirt module, the iPython utility, and to create a new virtual environment for our tests, follow these steps:

  1. Install the Python development packages pip and virtualenv:
root@kvm:~# apt-get install python-pip python-dev pkg-config build-essential autoconf libvirt-devroot@kvm:~# pip install virtualenvDownloading/unpacking virtualenv Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB): 1.8MB downloadedInstalling collected packages: virtualenvSuccessfully installed virtualenvCleaning up...root@kvm:~#
  1. Create a new Python virtual environment and activate it:
root@kvm:~# mkdir kvm_pythonroot@kvm:~# virtualenv kvm_python/New python executable in /root/kvm_python/bin/pythonInstalling setuptools, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required