pip install matplotlib:“无pkg-config"; [英] pip install matplotlib: "no pkg-config"

查看:63
本文介绍了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>

注意

  1. 无pkg-config"和
  2. 缺少的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:

  1. pip在何处安装matplotlib 会得到该 basedirlist (上面输出的第三行)?
  2. 为了使 pip install matplotlib 能够找到 pkg-config ,我该怎么做?
  3. 我必须做些什么才能使 pip install matplotlib 找到 qt ?
  1. Where does pip install matplotlib get that basedirlist (3rd line of the output above)?
  2. What must I do differently so that pip install matplotlib will find pkg-config?
  3. What must I do differently so that pip install matplotlib will find qt?

推荐答案

在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆