python - Errors occur when I import matplotlib and seaborn in OSX -
this question has answer here:
i installed matplotlib , seaborn successfully, however, when import them in python shell, many errors occur.
python 2.7.11 |anaconda 2.5.0 (x86_64)| (default, dec 6 2015, 18:57:58) [gcc 4.2.1 (apple inc. build 5577)] on darwin type "help", "copyright", "credits" or "license" more information. anaconda brought continuum analytics. please check out: http://continuum.io/thanks , https://anaconda.org traceback (most recent call last): file "<stdin>", line 1, in <module> file "/users/guanqingliang/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in <module> rcparams = rc_params() file "/users/guanqingliang/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params return rc_params_from_file(fname, fail_on_error) file "/users/guanqingliang/anaconda/lib/python2.7/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/guanqingliang/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file _open_file_or_url(fname) fd: file "/users/guanqingliang/anaconda/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() file "/users/guanqingliang/anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url encoding = locale.getdefaultlocale()[1] file "/users/guanqingliang/anaconda/lib/python2.7/locale.py", line 543, in getdefaultlocale return _parse_localename(localename) file "/users/guanqingliang/anaconda/lib/py`enter code here`thon2.7/locale.py", line 475, in _parse_localename raise valueerror, 'unknown locale: %s' % localename valueerror: unknown locale: utf-8
you need add following 2 lines ~/.bash_profile , type source ~/.bash_profile or restart terminal:
export lc_all=en_us.utf-8 export lang=en_us.utf-8
Comments
Post a Comment