Unknown Locale (missing env vars)

Hello, I´ve been having similar problems when viewing the plugins, I tried typing “conda install matplotlib==1.5.1” after I type qiime info the following message appears:

(qiime2) MacBook-Pro-de-Malena-3:~ mae$ qiime info
System versions
Traceback (most recent call last):
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/bin/qiime", line 6, in <module>
    sys.exit(q2cli.__main__.qiime())
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/info.py", line 77, in info
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/q2cli-0.0.6-py3.5.egg/q2cli/info.py", line 14, in _echo_version
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/__init__.py", line 10, in <module>
    from qiime.metadata import Metadata, MetadataCategory
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/qiime-2.0.6-py3.5.egg/qiime/metadata.py", line 9, in <module>
    import pandas as pd
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/__init__.py", line 39, in <module>
    from pandas.core.api import *
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/core/api.py", line 10, in <module>
    from pandas.core.groupby import Grouper
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/core/groupby.py", line 40, in <module>
    from pandas.core.frame import DataFrame
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/core/frame.py", line 72, in <module>
    from pandas.core.series import Series
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/core/series.py", line 2972, in <module>
    import pandas.tools.plotting as _gfx  # noqa
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/tools/plotting.py", line 34, in <module>
    import pandas.tseries.converter as conv
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/pandas/tseries/converter.py", line 7, in <module>
    import matplotlib.units as units
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1131, in <module>
    rcParams = rc_params()
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 975, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/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 "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
    with _open_file_or_url(fname) as fd:
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
    encoding = locale.getdefaultlocale()[1]
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/Users/mae/Desktop/Shell/ENTER/envs/qiime2/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8

Thanks for your help!
Malena

Hi @malenaamer, it looks like your environment is missing some locale configuration variables.
Can you run the following and let us know what the results are?

$ echo $LC_ALL
$ echo $LANG

You probably need to manually set these values, by adding something like the following lines to the file /Users/mae/.bashrc:

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

The en_US.UTF-8 is specific to your language needs (this example is U.S. english), but you need to specify the UTF-8 variant of your locale. You can see the installed locales on your machine by running locale -a. Let us know if we can provide any additional help. Thanks!

1 Like

@malenaamer, I just came across this page while looking into another problem, and I thought you might want to take a peek at this, too:

http://conda.pydata.org/docs/troubleshooting.html#unknown-locale

Hope that helps!

1 Like