title: Python - ValueError: unknown locale: UTF-8
body: <p>I run the python script that contain Pandas (that one cause the problem) library I got this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 2, in &lt;module&gt;
      import pandas
  ImportError: No module named pandas
  </code></pre>
  
  <p>But if I import from package path to make sure it detects Pandas library, I got this error message</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 3, in &lt;module&gt;
      import pandas
    File "/usr/local/lib/python2.7/site-packages/pandas/__init__.py", line 44, in &lt;module&gt;
      from pandas.core.api import *
    File "/usr/local/lib/python2.7/site-packages/pandas/core/api.py", line 9, in &lt;module&gt;
      from pandas.core.groupby import Grouper
    File "/usr/local/lib/python2.7/site-packages/pandas/core/groupby.py", line 16, in &lt;module&gt;
      from pandas.core.frame import DataFrame
    File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 41, in &lt;module&gt;
      from pandas.core.series import Series
    File "/usr/local/lib/python2.7/site-packages/pandas/core/series.py", line 2864, in &lt;module&gt;
      import pandas.tools.plotting as _gfx
    File "/usr/local/lib/python2.7/site-packages/pandas/tools/plotting.py", line 28, in &lt;module&gt;
      import pandas.tseries.converter as conv
    File "/usr/local/lib/python2.7/site-packages/pandas/tseries/converter.py", line 7, in &lt;module&gt;
      import matplotlib.units as units
    File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in &lt;module&gt;
      rcParams = rc_params()
    File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params
      return rc_params_from_file(fname, fail_on_error)
    File "/usr/local/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 "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
      with _open_file_or_url(fname) as fd:
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__
      return self.gen.next()
    File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
      encoding = locale.getdefaultlocale()[1]
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
      return _parse_localename(localename)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
      raise ValueError, 'unknown locale: %s' % localename
  ValueError: unknown locale: UTF-8
  </code></pre>
  
  <p>I already update my <code>.bash_profile</code> and <code>.bashrc</code> with these lines but still not working even I already restart the terminal and my machine.</p>
  
  <pre><code>export LANG="it_IT.UTF-8"  
  export LC_COLLATE="it_IT.UTF-8"  
  export LC_CTYPE="it_IT.UTF-8"  
  export LC_MESSAGES="it_IT.UTF-8"  
  export LC_MONETARY="it_IT.UTF-8"  
  export LC_NUMERIC="it_IT.UTF-8"  
  export LC_TIME="it_IT.UTF-8"  
  export LC_ALL="it_IT.UTF-8"
  </code></pre>
  
  <p>I'm also enabled <code>Set locale environment variables on startup</code> in the terminal preferences. </p>
  
  <p><a href="https://i.stack.imgur.com/Yfo9e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yfo9e.png" alt="enter image description here"></a></p>
  
  <p>I'm afraid the problem caused because of El Capitan.</p>