[Solved]: ValueError: unknown locale: UTF-8

ERROR:

$ python main.py --inference-mode/anaconda3/lib/python3.5/site-packages/PIL/Image.py:85: RuntimeWarning: The _imaging extension was built for another  version of Pillow or PIL  warnings.warn(str(v), RuntimeWarning)/anaconda3/lib/python3.5/site-packages/PIL/Image.py:85: RuntimeWarning: The _imaging extension was built for another  version of Pillow or PIL  warnings.warn(str(v), RuntimeWarning)/anaconda3/lib/python3.5/site-packages/PIL/Image.py:85: RuntimeWarning: The _imaging extension was built for another  version of Pillow or PIL  warnings.warn(str(v), RuntimeWarning)Traceback (most recent call last):  File "main.py", line 14, in <module>    import tensorflow as tf  File "/anaconda3/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>    from tensorflow.python import *  File "/anaconda3/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 83, in <module>    from tensorflow.python.estimator import estimator_lib as estimator  File "/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/estimator_lib.py", line 35, in <module>    from tensorflow.python.estimator.inputs import inputs  File "/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/inputs.py", line 22, in <module>    from tensorflow.python.estimator.inputs.numpy_io import numpy_input_fn  File "/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/numpy_io.py", line 22, in <module>    from tensorflow.python.estimator.inputs.queues import feeding_functions  File "/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/queues/feeding_functions.py", line 40, in <module>    import pandas as pd  File "/anaconda3/lib/python3.5/site-packages/pandas/__init__.py", line 42, in <module>    from pandas.core.api import *  File "/anaconda3/lib/python3.5/site-packages/pandas/core/api.py", line 10, in <module>    from pandas.core.groupby.groupby import Grouper  File "/anaconda3/lib/python3.5/site-packages/pandas/core/groupby/__init__.py", line 2, in <module>    from pandas.core.groupby.groupby import (  File "/anaconda3/lib/python3.5/site-packages/pandas/core/groupby/groupby.py", line 49, in <module>    from pandas.core.frame import DataFrame  File "/anaconda3/lib/python3.5/site-packages/pandas/core/frame.py", line 74, in <module>    from pandas.core.series import Series  File "/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 81, in <module>    import pandas.plotting._core as gfx  File "/anaconda3/lib/python3.5/site-packages/pandas/plotting/__init__.py", line 11, in <module>    from pandas.plotting._core import boxplot  File "/anaconda3/lib/python3.5/site-packages/pandas/plotting/_core.py", line 45, in <module>    from pandas.plotting import _converter  File "/anaconda3/lib/python3.5/site-packages/pandas/plotting/_converter.py", line 8, in <module>    import matplotlib.units as units  File "/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py", line 1131, in <module>    rcParams = rc_params()  File "/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py", line 975, in rc_params    return rc_params_from_file(fname, fail_on_error)  File "/anaconda3/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 "/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file    with _open_file_or_url(fname) as fd:  File "/anaconda3/lib/python3.5/contextlib.py", line 59, in __enter__    return next(self.gen)  File "/anaconda3/lib/python3.5/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url    encoding = locale.getdefaultlocale()[1]  File "/anaconda3/lib/python3.5/locale.py", line 559, in getdefaultlocale    return _parse_localename(localename)  File "/anaconda3/lib/python3.5/locale.py", line 487, in _parse_localename    raise ValueError('unknown locale: %s' % localename)ValueError: unknown locale: UTF-8

Solution:  Looks like you’re on OS X. Append this to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8export LANG=en_US.UTF-8

And then run:

$ source ~/.bash_profile