<p dir="auto">Hi, I'm getting the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import matplotlib
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-1-82be63b7783c&gt; in &lt;module&gt;()
----&gt; 1 import matplotlib

/Users/Gustaf/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/Gustaf/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/Gustaf/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     &quot;&quot;&quot;
-&gt; 1100     config_from_file = _rc_params_in_file(fname, fail_on_error)
   1101 
   1102     if not use_default_template:

/Users/Gustaf/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/Gustaf/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(&quot;generator didn't yield&quot;) from None

/Users/Gustaf/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 = &quot;utf-8&quot;

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

/Users/Gustaf/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"><pre class="notranslate"><code class="notranslate">import matplotlib
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-1-82be63b7783c&gt; in &lt;module&gt;()
----&gt; 1 import matplotlib

/Users/Gustaf/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/Gustaf/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/Gustaf/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/Gustaf/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/Gustaf/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/Gustaf/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/Gustaf/anaconda/lib/python3.5/locale.py in getdefaultlocale(envvars)
    557     else:
    558         localename = 'C'
--&gt; 559     return _parse_localename(localename)
    560 
    561 

/Users/Gustaf/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></div>
<p dir="auto">Any ideas how to fix this? Thanks!</p>
<p dir="auto">Hi guys!<br>
I am new to python and matplotlib.<br>
I installed everything with macports and when I run the matplotlib test</p>
<p dir="auto">python2.7 -c 'import matplotlib; print matplotlib.<strong>version</strong>, matplotlib.<strong>file</strong>'</p>
<p dir="auto">I get the following</p>
<p dir="auto">Traceback (most recent call last):<br>
File "", line 1, in <br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/<strong>init</strong>.py", line 1131, in <br>
rcParams = rc_params()<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/<strong>init</strong>.py", line 975, in rc_params<br>
return rc_params_from_file(fname, fail_on_error)<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/<strong>init</strong>.py", line 1100, in rc_params_from_file<br>
config_from_file = _rc_params_in_file(fname, fail_on_error)<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/<strong>init</strong>.py", line 1018, in _rc_params_in_file<br>
with _open_file_or_url(fname) as fd:<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in <strong>enter</strong><br>
return self.gen.next()<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/<strong>init</strong>.py", line 1000, in _open_file_or_url<br>
encoding = locale.getdefaultlocale()[1]<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale<br>
return _parse_localename(localename)<br>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename<br>
raise ValueError, 'unknown locale: %s' % localename<br>
ValueError: unknown locale: UTF-8</p>
<p dir="auto">Do you guys have any idea what is happening....I have not done enything weards just follow simple steps to install it.</p>
<p dir="auto">I want to use QUTIP  and the matplotlib is essential for it...please if someone know it would be really nice</p>
<p dir="auto">thanks!<br>
regards,</p>