can't install matplotlib using pip [duplicate]

2019-03-24 15:50发布

This question already has an answer here:

I'm on Ubuntu 14.04, and have been trying to install matplotlib using pip. I'm using Python 2.7.6. However, whenever I run "sudo pip install matplotlib", I get the following errors:

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

I've tried installing all the dependencies listed under "required dependencies and extensions", but I still get the same error.

1条回答
smile是对你的礼貌
2楼-- · 2019-03-24 16:38

I was seeing the same error message and installing the dependencies mentioned in this post Pip install Matplotlib error with virtualenv resolved the issue for me.

查看更多
登录 后发表回答