libvirt-python安装在mac错误上

时间:2017-02-07 19:44:11

标签: python macos python-2.7 libvirt

当我尝试通过以下方式安装libvirt-python时:

 pip install libvirt-python

我收到以下错误:

Collecting libvirt-python
  Downloading libvirt-python-2.5.0.tar.gz (172kB)
    100% |████████████████████████████████| 174kB 2.4MB/s
Building wheels for collected packages: libvirt-python
  Running setup.py bdist_wheel for libvirt-python ... error
  Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/tmp79QS6spip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  /usr/local/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
  /usr/local/opt/python/bin/python2.7 generator.py libvirt /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
  Found 418 functions in /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
  Found 0 functions in libvirt-override-api.xml
  Generated 344 wrapper functions
  Missing type converters:
  virConnectSecretEventGenericCallback:1
  virStorageVolInfoPtr:1
  ERROR: failed virConnectSecretEventRegisterAny
  ERROR: failed virStorageVolGetInfoFlags
  error: command '/usr/local/opt/python/bin/python2.7' failed with exit status 1

  ----------------------------------------
  Failed building wheel for libvirt-python
  Running setup.py clean for libvirt-python
Failed to build libvirt-python
Installing collected packages: libvirt-python
  Running setup.py install for libvirt-python ... error
    Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-eNRl_m-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    /usr/local/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
    /usr/local/opt/python/bin/python2.7 generator.py libvirt /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
    Found 418 functions in /usr/local/Cellar/libvirt/3.0.0/share/libvirt/api/libvirt-api.xml
    Found 0 functions in libvirt-override-api.xml
    Generated 344 wrapper functions
    Missing type converters:
    virConnectSecretEventGenericCallback:1
    virStorageVolInfoPtr:1
    ERROR: failed virConnectSecretEventRegisterAny
    ERROR: failed virStorageVolGetInfoFlags
    error: command '/usr/local/opt/python/bin/python2.7' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-eNRl_m-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/h4/8vv21pzx2k9471lzymg_r3th0000gp/T/pip-build-JcUj3e/libvirt-python/

任何帮助都会受到赞赏,因为我不知道如何解决这个问题。

Mac 10.11.4 Python 2.7.13& 2.7.10 libvirt通过brew安装

Warning: libvirt-3.0.0 already installed

2 个答案:

答案 0 :(得分:1)

你需要安装libvirt-python 3.0.0,但PyPI上的那个仍然是2.5.0。改为运行此命令:

pip install https://libvirt.org/sources/python/libvirt-python-3.0.0.tar.gz

参考:

答案 1 :(得分:1)

我们忘记将3.0.0版本上传到PyPI。这个错误现在已经解决了,所以如果你重试它应该正确构建。