2012-10-30 38 views
2

我參考了this article,但使用了更多最近的庫。要明確,我下載 libgpg-error-1.10libgcrypt-1.5.0gnutls-3.1.3libvirt-1.0.0如何在Mac上構建和安裝libvirt?

libgpg-error-1.10,安裝OK libgcrypt-1.5.0當配置gnutls-3.1.3,一個錯誤出現:

configure: error:

* Libnettle 2.5 was not found. Note that you must compile nettle with gmp support.

我想是使用libvirt的的Python綁定(即python中的import libvirt)。任何人都可以解釋如何獲得一個可用的python libvirt庫嗎?

回答

9

你最簡單的選擇可能是使用homebrew安裝libvirt

$ brew install libvirt 

在編譯的Python綁定libvirt後應該是微不足道的。

+2

lib virt python綁定是自動編譯的,但需要從/usr/local/Cellar/libvirt/0.9.11.6/lib/python2.7/site-packages下的'/ Library/Python/2.7/site-packages /'下鏈接/'手動 –

7

在安裝libvirt的使用:

$ brew install libvirt

你可以用PIP安裝libvirt的python綁定:

$ pip install libvirt-python

0

我跑在一個相當新的MacOSX 10.10以下命令。 5

bash-3.2$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
bash-3.2$ brew install libvirt 
bash-3.2$ brew install libvirt-python 
bash-3.2$ pip install libvirt-python 
bash-3.2$ echo Instructions at http://stackoverflow.com/questions/13136884/how-to-build-and-install-libvirt-on-mac do not work. 

bash-3.2$ sudo easy_install pip 
bash-3.2$ pip install libvirt-python 
bash-3.2$ echo typical python stuff up - when the install of a tool gets in your way - toss the tool 
bash-3.2$ echo unless the tool has worked many many times before. 
bash-3.2$ pip install pkg-config 
bash-3.2$ brew install pkg-config 
bash-3.2$ pip install libvirt-python 
bash-3.2$ sudo pip install libvirt-python 
bash-3.2$