Using pylab with ipython - ValueError: unknown locale: UTF-8
<p>I'm required to install ipython and use pylab for my signals and systems class. </p>

<p>I already have ipython up and running (python version 3.5).</p>

<p>I can't get pylab to initialise. </p>

<p>I already installed matplotlib.
When I type ipython --pylab in the terminal I get the following:</p>

<pre><code>IPython 4.0.3 -- An enhanced Interactive Python.
?         -&gt; Introduction and overview of IPython's features.
%quickref -&gt; Quick reference.
help      -&gt; Python's own help system.
object?   -&gt; Details about 'object', use 'object??' for extra details.
[TerminalIPythonApp] WARNING | GUI event loop or pylab initialization failed
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/IPython/core/shellapp.py in &lt;lambda&gt;(key)
    217         shell = self.shell
    218         if self.pylab:
--&gt; 219             enable = lambda key: shell.enable_pylab(key, import_all=self.pylab_import_all)
    220             key = self.pylab
    221         elif self.matplotlib:

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py in enable_pylab(self, gui, import_all, welcome_message)
   3169         from IPython.core.pylabtools import import_pylab
   3170 
-&gt; 3171         gui, backend = self.enable_matplotlib(gui)
   3172 
   3173         # We want to prevent the loading of pylab to pollute the user's

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui)
   3118         """
   3119         from IPython.core import pylabtools as pt
-&gt; 3120         gui, backend = pt.find_gui_and_backend(gui, self.pylab_gui_select)
   3121 
   3122         if gui != 'inline':

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/IPython/core/pylabtools.py in find_gui_and_backend(gui, gui_select)
    237     """
    238 
--&gt; 239     import matplotlib
    240 
    241     if gui and gui != 'auto':

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in &lt;module&gt;()
   1129 
   1130 # this is the instance used by the matplotlib classes
-&gt; 1131 rcParams = rc_params()
   1132 
   1133 if rcParams['examples.directory']:

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in rc_params(fail_on_error)
    973         return ret
    974 
--&gt; 975     return rc_params_from_file(fname, fail_on_error)
    976 
    977 

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in rc_params_from_file(fname, fail_on_error, use_default_template)
   1098         parameters specified in the file. (Useful for updating dicts.)
   1099     """
-&gt; 1100     config_from_file = _rc_params_in_file(fname, fail_on_error)
   1101 
   1102     if not use_default_template:

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in _rc_params_in_file(fname, fail_on_error)
   1016     cnt = 0
   1017     rc_temp = {}
-&gt; 1018     with _open_file_or_url(fname) as fd:
   1019         try:
   1020             for line in fd:

/Users/ruiloureiro/anaconda/lib/python3.5/contextlib.py in __enter__(self)
     57     def __enter__(self):
     58         try:
---&gt; 59             return next(self.gen)
     60         except StopIteration:
     61             raise RuntimeError("generator didn't yield") from None

/Users/ruiloureiro/anaconda/lib/python3.5/site-packages/matplotlib/__init__.py in _open_file_or_url(fname)
    998     else:
    999         fname = os.path.expanduser(fname)
-&gt; 1000         encoding = locale.getdefaultlocale()[1]
   1001         if encoding is None:
   1002             encoding = "utf-8"

/Users/ruiloureiro/anaconda/lib/python3.5/locale.py in getdefaultlocale(envvars)
    557     else:
    558         localename = 'C'
--&gt; 559     return _parse_localename(localename)
    560 
    561 

/Users/ruiloureiro/anaconda/lib/python3.5/locale.py in _parse_localename(localename)
    485     elif code == 'C':
    486         return None, None
--&gt; 487     raise ValueError('unknown locale: %s' % localename)
    488 
    489 def _build_localename(localetuple):

ValueError: unknown locale: UTF-8
</code></pre>

<p>Any idea what's causing this?</p>