やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

matplotlibをインストールした

約54MB。

前回

http://ytyaru.hatenablog.com/entry/2018/07/21/000000

matplotlibインストール(1回目)

$ pip install matplotlib
Collecting matplotlib
  Downloading matplotlib-2.0.2.tar.gz (53.9MB)
    100% |████████████████████████████████| 53.9MB 5.5kB/s 
    Complete output from command python setup.py egg_info:
    ============================================================================
    Edit setup.cfg to change the build options
    
    BUILDING MATPLOTLIB
                matplotlib: yes [2.0.2]
                    python: yes [3.6.1 (default, Apr 24 2017, 22:16:16)  [GCC
                            4.8.4]]
                  platform: yes [linux]
    
    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.13.1]
                       six: yes [six was not found.pip will attempt to install
                            it after matplotlib.]
                  dateutil: yes [dateutil was not found. It is required for date
                            axis support. pip/easy_install may attempt to
                            install it after matplotlib.]
               functools32: yes [Not required]
              subprocess32: yes [Not required]
                      pytz: yes [pytz was not found. pip will attempt to install
                            it after matplotlib.]
                    cycler: yes [cycler was not found. pip will attempt to
                            install it after matplotlib.]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: no  [pkg-config information for 'libpng' could not
                            be found.]
                     qhull: yes [pkg-config information for 'qhull' could not be
                            found. Using local copy.]
    
    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]
    
    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                    gtkagg: no  [Requires pygtk]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: no  [Microsoft Windows only]
    
    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
               ghostscript: yes [version 9.10]
                     latex: no
                   pdftops: yes [version 0.24.5]
    
    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]
    
    ============================================================================
                            * The following required packages can not be built:
                            * freetype, png
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5alv27lm/matplotlib/

どうやら最後の1行をみるに失敗したらしい…。freetype: noのようにnoになっているものをインストールする必要がありそう。

REQUIRED DEPENDENCIES AND EXTENSIONSのうちnoなのはfreetypelibpngの2つか。開発用パッケージが必要らし。

                  freetype: no  [The C/C++ header for freetype2 (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: no  [pkg-config information for 'libpng' could not
                            be found.]

matplotlibのインストールでつまづいた話 - Qiita

freetypeインストー

LinuxMint17.3ではSynapticを使ってインストールする。

f:id:ytyaru:20170728212930p:plain

f:id:ytyaru:20170728212947p:plain

libpngも依存関係でインストールしてくれるらしい。

「詳細を表示」すると以下。

libfreetype6 (バージョン 2.5.2-1ubuntu2.5) はバージョン 2.5.2-1ubuntu2.8 にアップグレードされます
libpng12-0 (バージョン 1.2.50-1ubuntu2) はバージョン 1.2.50-1ubuntu2.14.04.2 にアップグレードされます
libfreetype6-dev (バージョン 2.5.2-1ubuntu2.8) がインストールされます
libpng12-dev (バージョン 1.2.50-1ubuntu2.14.04.2) がインストールされます

matplotlibインストール(2回目)

$ pip install matplotlib
Collecting matplotlib
  Using cached matplotlib-2.0.2.tar.gz
Requirement already satisfied: numpy>=1.7.1 in /.../game/lib/python3.6/site-packages (from matplotlib)
Collecting six>=1.10 (from matplotlib)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting python-dateutil (from matplotlib)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 871kB/s 
Collecting pytz (from matplotlib)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Collecting cycler>=0.10 (from matplotlib)
  Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib)
  Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 480kB/s 
Installing collected packages: six, python-dateutil, pytz, cycler, pyparsing, matplotlib
  Running setup.py install for matplotlib ... done
Successfully installed cycler-0.10.0 matplotlib-2.0.2 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2017.2 six-1.10.0
$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
cycler (0.10.0)
matplotlib (2.0.2)
numpy (1.13.1)
olefile (0.44)
pgu (0.18)
Pillow (4.2.1)
pip (9.0.1)
pygame (1.9.3)
PyOpenGL (3.1.0)
PyOpenGL-accelerate (3.1.0)
PyOpenGL-Demo (3.0.0)
pyparsing (2.2.0)
python-dateutil (2.6.1)
pytz (2017.2)
setuptools (28.8.0)
six (1.10.0)

以下のものがインストールされたっぽい。

  • cycler
  • matplotlib
  • pyparsing
  • python-dateutil
  • pytz
  • six

所感

容量が圧迫されていく。