關於pip安裝libvirt-python的時候提示Package libvirt was not found in the pkg-config search path
的問題解決方法
- 1、一開始以為是網絡原因,嘗試不同的版本也不行,【未果】
- 2、在網上查閱資料后說是缺少libvirt.py這個文件,建議從安裝包中拷貝過來,但是這個是pip安裝不同於其它的開源軟件,所以這個也行不通,可以參考以下鏈接
http://cgwxyz.blog.163.com/blog/static/262806020105307929424/
- 3、直到看到有網友說是需要安裝
libvirt-devel
之后,才恍然大悟,其實安裝完這個包之后就有/usr/lib64/pkgconfig/libvirt.pc
這個文件了
關鍵的一句You probably need libvirt-dev(el) package installed.
,然后執行yum install -y libvirt-devel
就沒有問題了
錯誤提示如下:
Running command python setup.py egg_info
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 egg_info
creating pip-egg-info/libvirt_python.egg-info
writing pip-egg-info/libvirt_python.egg-info/PKG-INFO
writing top-level names to pip-egg-info/libvirt_python.egg-info/top_level.txt
writing dependency_links to pip-egg-info/libvirt_python.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/libvirt_python.egg-info/SOURCES.txt'
file build/libvirt.py (for module libvirt) not found
file build/libvirt_qemu.py (for module libvirt_qemu) not found
reading manifest file 'pip-egg-info/libvirt_python.egg-info/SOURCES.txt'
writing manifest file 'pip-egg-info/libvirt_python.egg-info/SOURCES.txt'
... ...
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