2017-08-03 7 views
0

Ich versuche derzeit libvirt-python zu einem virtualenv zu installieren.pip install libvirt-python schlägt in virtualenv

Wenn ich es laufen lasse, bekomme ich diese Ausgabe

$ pip install libvirt-python 
Collecting libvirt-python 
    Using cached libvirt-python-3.5.0.tar.gz 
Building wheels for collected packages: libvirt-python 
    Running setup.py bdist_wheel for libvirt-python ... error 
    Complete output from command /home/john/virtenvs/hw/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3_fz8vok/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 /tmp/tmpg1j1nq_wpip-wheel- --python-tag cp35: 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    running bdist_wheel 
    running build 
    /usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    error: command '/usr/bin/pkg-config' 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 /home/john/virtenvs/hw/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3_fz8vok/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 /tmp/pip-leu8ei67-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/john/virtenvs/hw/include/site/python3.5/libvirt-python: 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    running install 
    running build 
    /usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt 
    Package libvirt was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `libvirt.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'libvirt' found 
    error: command '/usr/bin/pkg-config' failed with exit status 1 

    ---------------------------------------- 
Command "/home/john/virtenvs/hw/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-3_fz8vok/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 /tmp/pip-leu8ei67-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/john/virtenvs/hw/include/site/python3.5/libvirt-python" failed with error code 1 in /tmp/pip-build-3_fz8vok/libvirt-python/ 

Ohne die virtualenv Ich bin in der Lage libvirt in meine Python-Shell zu importieren.

+1

Haben Sie getan, wie die Fehlermeldung suggeriert: "Vielleicht sollten Sie das Verzeichnis, das' libvirt.pc 'enthält, zur Umgebungsvariablen PKG_CONFIG_PATH hinzufügen "? – Evert

Antwort

2

Die pip Installation von libvirt-python installiert erfordert die Datei libvirt.pc auf Ihrem System vorhanden sein, weil das Installationsskript pkg-config verwendet Überprüfen Sie die Paketdetails von libvirt.

Für Debian fand ich, dass diese Datei vom Paket `libvirt-dev 'bereitgestellt wird. So könnte man versuchen

apt-get install libvirt-dev

oder etwas Gleichwertiges für Ihre Distribution.

-1

Wenn Sie auf deb-basierte OS sind sicher, dass Sie libvirt-dev Paket

Verwandte Themen