--Python 3.4.3 (in Pyenv)
The latest version is included as of December 11, 2015
Traceback (most recent call last): File "
", line 1, in File "/Users/user/graph/lib/python3.4/site-packages/matplotlib/init.py", line 1131, in rcParams = rc_params() File "/Users/user/graph/lib/python3.4/site-packages/matplotlib/init.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) File "/Users/user/graph/lib/python3.4/site-packages/matplotlib/init.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error) File "/Users/user/graph/lib/python3.4/site-packages/matplotlib/init.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd: File "/Users/user/.pyenv/versions/3.4.3/lib/python3.4/contextlib.py", line 59, in enter return next(self.gen) File "/Users/user/graph/lib/python3.4/site-packages/matplotlib/init.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] File "/Users/user/graph/lib/python3.4/locale.py", line 556, in getdefaultlocale return _parse_localename(localename) File "/Users/user/graph/lib/python3.4/locale.py", line 484, in _parse_localename raise ValueError('unknown locale: %s' % localename) ValueError: unknown locale: UTF-8
In short, locale: UTF-8
export
(graph)pc-name:graph user$ export LC_ALL='ja_JP.UTF-8'
(graph)pc-name:graph user$ locale
LANG=
LC_COLLATE="ja_JP.UTF-8"
LC_CTYPE="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_ALL="ja_JP.UTF-8" #this guy
>>> import matplotlib.pyplot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user/.pyenv/versions/3.4.3/lib/python3.4/site-packages/matplotlib/pyplot.py", line 114, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/user/.pyenv/versions/3.4.3/lib/python3.4/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/Users/user/.pyenv/versions/3.4.3/lib/python3.4/site-packages/matplotlib/backends/backend_macosx.py", line 24, in <module>
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ
I'm still doing something ...
backend : TkAgg
Add
Also, as @aion pointed out, it seems that you can also take measures against this error below! Thank you @aion: muscle:
import matplotlib
matplotlib.use('TkAgg')
Recommended Posts