pip install matplotlib:“无pkg-config"; [英] pip install matplotlib: "no pkg-config"
本文介绍了pip install matplotlib:“无pkg-config";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我运行 pip install matplotlib
(在virtualenv内)时,输出的第一行是:
When I run pip install matplotlib
(within a virtualenv), the first lines of output are:
Downloading/unpacking matplotlib
Running setup.py egg_info for package matplotlib
basedirlist is: ['/usr/local/', '/usr', '/usr/X11', '/opt/local']
============================================================================
BUILDING MATPLOTLIB
matplotlib: 1.2.0
python: 2.7.3 (default, Dec 14 2012, 13:31:05) [GCC 4.2.1
(Apple Inc. build 5666) (dot 3)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.6.2
freetype2: found, but unknown version (no pkg-config)
OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
Tkinter: Tkinter: 81008, Tk: 8.5, Tcl: 8.5
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: yes
Qt: no
Qt4: no
PySide: no
Cairo: no
<snip>
注意
- 无pkg-config"和
- 缺少的Qt库.
首先,与上面的输出相反,pkg-config
is 实际上已安装并在 PATH
上:
First, contrary to what the output above says, pkg-config
is in fact installed and on the PATH
:
% pkg-config --version
0.27.1
% which pkg-config
/usr/local/bin/pkg-config
第二, qt
在找到 freetype
和 libpng
的同一目录中可用:
Second, qt
is available in the same directory where freetype
and libpng
were found:
% ls -l /usr/local/opt/{freetype,libpng,qt} | cut -c43-
/usr/local/opt/freetype -> ../Cellar/freetype/2.4.10/
/usr/local/opt/libpng -> ../Cellar/libpng/1.5.13/
/usr/local/opt/qt -> ../Cellar/qt/4.8.4/
我的问题分为三个部分:
My question has three parts:
-
pip在何处安装matplotlib
会得到该basedirlist
(上面输出的第三行)? - 为了使
pip install matplotlib
能够找到pkg-config
,我该怎么做? - 我必须做些什么才能使
pip install matplotlib
找到qt
?
- Where does
pip install matplotlib
get thatbasedirlist
(3rd line of the output above)? - What must I do differently so that
pip install matplotlib
will findpkg-config
? - What must I do differently so that
pip install matplotlib
will findqt
?
推荐答案
在 Mac OS 上:我使用 which pkg-config
来检查安装.如果没有,请使用brew安装,并且可以正常工作:
On Mac OS: I use which pkg-config
to check installation. If not, use brew to install and it works:
brew install pkg-config
这篇关于pip install matplotlib:“无pkg-config";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文