无法使用pip安装matplotlib

mp9*_*p94 14 python pip matplotlib python-2.7

我在Ubuntu 14.04上,并一直在尝试使用pip安装matplotlib.我正在使用Python 2.7.6.但是,每当我运行"sudo pip install matplotlib"时,我都会收到以下错误:

Downloading/unpacking matplotlib
Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded
Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib
  ============================================================================
  Edit setup.cfg to change the build options

  BUILDING MATPLOTLIB
            matplotlib: yes [1.4.0]
                python: yes [2.7.6 (default, Mar 22 2014, 22:59:56)  [GCC
                        4.8.2]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.8.1]
                   six: yes [using six version 1.5.2]
              dateutil: yes [using dateutil version 2.2]
               tornado: yes [using tornado version 4.0.1]
             pyparsing: yes [using pyparsing version 2.0.2]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
    result = package.check()
  File "setupext.py", line 940, in check
    if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
Complete output from command python setup.py egg_info:
============================================================================

Edit setup.cfg to change the build options
Run Code Online (Sandbox Code Playgroud)

我已经尝试安装"必需的依赖项和扩展"下列出的所有依赖项,但我仍然得到相同的错误.

小智 12

我看到相同的错误消息并安装此帖子中提到的依赖项Pip install Matplotlib错误与virtualenv解决了我的问题.

  • 在那里安装了三个推荐的软件包,`libjpeg8-dev`,`libfreetype6-dev`和`libpng12-dev`工作了!(我已经安装了freetype和png软件包)还按照原始帖子的评论安装了`libagg-dev`. (7认同)
  • sudo apt-get build-dep matplotlib在Ubuntu 14.04上为我工作 (5认同)
  • 在mac:`brew install freetype` (3认同)