pyenv で OS X に python をインストールしたあとに、matplotlib の実行で以下のエラーが生じた。
RuntimeError: Python is not installed as a framework. ...
framework としてインストールされていないので(pyenv でインストールしたから .pyenv/ の下に普通にインストールされている)、描画するのに必要なライブラリか何かを正しく使えないということなのだと思う。
そもそも matplotlib が見つからない、という場合は、
sudo -H pip install matplotlib
でまずインストールする。
この RuntimeError を解消するには、matplotlib インストール時に作成される
~/.matplotlib
の中に、matplotlibrc というファイルを作成し、
backend : TkAgg
と一行書けばよいらしい。
たしかに、RuntimeError のメッセージに
.... or try one of the other backends. ...
と書かれていた。
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend
によると、
The canonical renderer for user interfaces is
とのことだった。
Python 関連メモの目次
RuntimeError: Python is not installed as a framework. ...
framework としてインストールされていないので(pyenv でインストールしたから .pyenv/ の下に普通にインストールされている)、描画するのに必要なライブラリか何かを正しく使えないということなのだと思う。
そもそも matplotlib が見つからない、という場合は、
sudo -H pip install matplotlib
でまずインストールする。
この RuntimeError を解消するには、matplotlib インストール時に作成される
~/.matplotlib
の中に、matplotlibrc というファイルを作成し、
backend : TkAgg
と一行書けばよいらしい。
たしかに、RuntimeError のメッセージに
.... or try one of the other backends. ...
と書かれていた。
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend
によると、
The canonical renderer for user interfaces is
Agg
which uses the Anti-Grain Geometry C++ library to make a raster (pixel) image of the figure. All of the user interfaces except macosx
can be used with agg rendering, e.g., WXAgg
, GTKAgg
, QT4Agg
, TkAgg
.とのことだった。
![やじるし](https://emoji.ameba.jp/img/user/yu/yuka-k-blog/12799.gif)