如何在Mac上构建和安装libvirt?

2024-09-26 17:40:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我引用了this article,但使用了更新的库。坦白说,我下载了 libgpg-error-1.10libgcrypt-1.5.0gnutls-3.1.3libvirt-1.0.0

libgpg-error-1.10libgcrypt-1.5.0安装正常,配置时出现错误:

configure: error:

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

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


Tags: configure错误articlenoterrorthislibvirtnote
3条回答

最简单的选项可能是使用homebrew安装libvirt

$ brew install libvirt

在那之后,为libvirt编译Python绑定应该很简单。

使用以下命令安装libvirt之后:

$ brew install libvirt

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

$ pip install libvirt-python

我在一个相当新的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$ 

相关问题 更多 >

    热门问题