Ubuntu15.04でpipでMatplotlibがインストールできない件
matplotlibのドキュメント(Installing — Matplotlib 1.4.3 documentation)にはこんな感じで書いてありました。
Linux : using your package manager
If you are on Linux, you might prefer to use your package manager. matplotlib is packaged for almost every major Linux distribution.
- Debian / Ubuntu : sudo apt-get install python-matplotlib
- Fedora / Redhat : sudo yum install python-matplotlib
Ubuntuでインストールするときはapt-get使おうねってことなんですが、ここで問題が、、、
この方法だと、どうやってもvirtualenv環境にはインストールできないですね。
pipでのインストール方法を探すと、ありました。さすがスタックオーバーフロー。
python - Pip install Matplotlib error with virtualenv - Stack Overflow
どうやら先に、libpng-devとlibjpeg8-devとlibfreetype6-devをapt-getでインストールしておくと、うまくいくみたいです。
:~$ sudo apt-get install libpng-dev libjpeg8-dev libfreetype6-dev
:~$ workon hoge
(hoge):~$pip3 install matplotlib
うまくインストール出来ました。