4

我参考了这篇文章,但使用了更新的库。明确地说,我下载 了libgpg-error-1.10,libgcrypt-1.5.0gnutls-3.1.3libvirt-1.0.0

libgpg-error-1.10libgcrypt-1.5.0安装成功,当配置时gnutls-3.1.3,出现错误:

配置:错误:

*未找到 Libnettle 2.5。请注意,您必须在支持 gmp 的情况下编译荨麻。

我想要的是使用 libvirt 的 python 绑定(即import libvirt在 python 中)。谁能解释如何获得一个可用的 python libvirt 库?

4

4 回答 4

11

您最简单的选择可能是使用自制软件安装libvirt

$ brew install libvirt

之后编译 Python 绑定libvirt应该是微不足道的。

于 2012-10-30T10:52:36.263 回答
7

安装 libvirt 后:

$ brew install libvirt

您可以使用 pip 安装 libvirt python 绑定:

$ pip install libvirt-python

于 2014-03-21T20:04:29.447 回答
0

安德鲁斯解决方案适用于El Capitan和向上的一次修改。由于这些版本不允许写访问,/usr/share您需要提供pkg-config的路径libvirt api,例如:

export PKG_CONFIG_PATH=/usr/local/Cellar/libvirt/4.3.0/lib/pkgconfig
于 2018-05-31T09:04:49.433 回答
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$ 
于 2015-10-13T07:42:09.880 回答