OS X El Capitan / Python 3.5.2 - matplotlib无法在脚本中运行

时间:2016-09-04 20:49:50

标签: python matplotlib

我无法让matplotlib在OS X El Capitan下工作。我使用的是Python 3.5.2,我安装了Anaconda 4.1.1。

与其他帖子类似,当我尝试运行一个涉及matplotlib的简单程序时(在我尝试的任何例子中都会发生),我得到以下内容:

Traceback (most recent call last):

File "example2.py", line 1, in <module> import matplotlib.pyplot as plt

File "//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py", line 1131, in <module> rcParams = rc_params()

File "//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error)

File "//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file config_from_file = _rc_params_in_file(fname, fail_on_error)

File "//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file with _open_file_or_url(fname) as fd:

File "//anaconda/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)

File "//anaconda/lib/python3.5/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1]

File "//anaconda/lib/python3.5/locale.py", line 558, in getdefaultlocale return parse_localename(localename)

File "//anaconda/lib/python3.5/locale.py", line 486, in _parse_localename raise 

ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

任何提示如何摆脱这个? 谢谢!

0 个答案:

没有答案