回心誌

日々是回心

なぜかCygwinでmatplotlib-1.3.0がインストールできなかった

CygwinX11をインストールしたからだと思うんだが、pythonでmatplotlibが使えなくなっていた。

Traceback (most recent call last):
  File "plotAve.py", line 2, in <module>
    import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot

なので、再度インストールしようとしたが、なぜかエラーが。

$ python setup.py install

(上の方は省略)

lib/matplotlib/tri/_tri.h:821:33: エラー: expected unqualified-id before numeric constant
lib/matplotlib/tri/_tri.cpp: コンストラクタ ‘RandomNumberGenerator::RandomNumberGenerator(long unsigned int)’ 内:
lib/matplotlib/tri/_tri.cpp:2180:28: エラー: expected identifier before numeric constant
lib/matplotlib/tri/_tri.cpp:2180:28: エラー: expected ‘{’ before numeric constant
lib/matplotlib/tri/_tri.cpp: 大域スコープ:
lib/matplotlib/tri/_tri.cpp:2180:28: エラー: expected unqualified-id before numeric constant
error: command 'gcc' failed with exit status 1

matplotlib-1.3.0でエラーが出たのでmatplotlib-1.2.1でやってみたらいけた。

Python 2.7.3 (default, Dec 18 2012, 13:50:09)
[GCC 4.5.3] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>>