matplotlibインストールでハマった...for pandas on CentOS6.6 (python 3.4.3) by vagrant

## やったこと
python環境をタイトルのとおり構築。

## 環境
* windows 7
* vagrantで構築したvm
* pythonはpyenvをつかってインストールなので詳細は割愛



※[pyenvでのインスト－ル](https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB0QFjAAahUKEwiI2KrOl5fIAhWnXaYKHcJwBbA&url=https%3A%2F%2Fgithub.com%2Fyyuu%2Fpyenv&usg=AFQjCNEKBnmSWmbm6g0Ld1XczEXivwQY6g&sig2=oB_eJlAfS5u6o-4r1MQGQg)はこちらの通り
※上記までは完了している前提
## pandasインストール
```
$ pip install pandas
```

## matplotlib（可視化ライブラリ）
```
$ pip install matplotlib
Collecting matplotlib
  Using cached matplotlib-1.4.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-ms7vpmo7/matplotlib/setup.py", line 155, in <module>
    　　　　　　　　　　　 ：
　　　　　　　　　　　　　 ：    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.4.3]
                    python: yes [3.4.3 (default, Sep 27 2015, 16:07:11)  [GCC
                            4.4.7 20120313 (Red Hat 4.4.7-16)]]
                  platform: yes [linux]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.3]
                       six: yes [using six version 1.9.0]
                  dateutil: yes [using dateutil version 2.4.2]
                      pytz: yes [using pytz version 2015.6]
                   tornado: yes [using tornado version 4.2.1]
                 pyparsing: yes [using pyparsing version 2.0.3]
                     pycxx: yes [Official versions of PyCXX are not compatible
                            with matplotlib on Python 3.x, since they lack
                            support for the buffer object.  Using local copy]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ms7vpmo7/matplotlib
```

と、エラー・・・
上記を見る限り、pycxx、libaggのとこで互換性がないなど言われている・・・

が、トライ&エラーを繰り返し、調べ・・・て調べた結果。。。上記が原因ではなく、

[Building Matplotlib requires libpng \(and freetype, as well\) which isn't a python library, so pip doesn't handle installing it \(or freetype\).
You'll need to install something along the lines of libpng-devel and freetype-devel (or whatever the equivalent is for your OS).
](http://stackoverflow.com/questions/9829175/pip-install-matplotlib-error-with-virtualenv)とのことで、pipではなく、yumで下記の通りインストール。

```
$ sudo yum install -y freetype*
$ sudo yum install -y libpng-devel
$ pip install matplotlib
```
```
Collecting matplotlib
  Using cached matplotlib-1.4.3.tar.gz
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in ./.pyenv/versions/3.4.3/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4 in ./.pyenv/versions/3.4.3/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./.pyenv/versions/3.4.3/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pytz in ./.pyenv/versions/3.4.3/lib/python3.4/site-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in ./.pyenv/versions/3.4.3/lib/python3.4/site-packages (from matplotlib)
Collecting nose>=0.11.1 (from matplotlib)
  Downloading nose-1.3.7-py3-none-any.whl (154kB)
    100% |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>| 155kB 683kB/s
Installing collected packages: nose, matplotlib
  Running setup.py install for matplotlib
Successfully installed matplotlib-1.4.3 nose-1.3.7
```

無事インストール完了。