0

Recently, I am trying the CodeRunner (version 2.2.2). My python is miniconda2, a scientific python. I can import numpy, but I cannot import pandas. That's tricky!!

I tried some solutions like: https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python. But it does not make it.

import numpy as np
print 'numpy imported!'
print '----------------------Success-----------------------------------'
import pandas as pd

error

numpy imported!
----------------------Success-----------------------------------
Traceback (most recent call last):
  File "Untitled.py", line 4, in <module>
    import pandas as pd
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/__init__.py", line 39, in <module>
    from pandas.core.api import *
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/core/api.py", line 10, in <module>
    from pandas.core.groupby import Grouper
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/core/groupby.py", line 18, in <module>
    from pandas.core.frame import DataFrame
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/core/frame.py", line 39, in <module>
    from pandas.core.series import Series
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/core/series.py", line 2944, in <module>
    import pandas.tools.plotting as _gfx  # noqa
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/tools/plotting.py", line 27, in <module>
    import pandas.tseries.converter as conv
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/pandas/tseries/converter.py", line 7, in <module>
    import matplotlib.units as units
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in <module>
    rcParams = rc_params()
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params
    return rc_params_from_file(fname, fail_on_error)
  File "/Users/chengfei/miniconda2/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 "/Users/chengfei/miniconda2/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
    with _open_file_or_url(fname) as fd:
  File "/Users/chengfei/miniconda2/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/Users/chengfei/miniconda2/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
    encoding = locale.getdefaultlocale()[1]
  File "/Users/chengfei/miniconda2/lib/python2.7/locale.py", line 545, in getdefaultlocale
    return _parse_localename(localename)
  File "/Users/chengfei/miniconda2/lib/python2.7/locale.py", line 477, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
  • check out the answers here: http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-error-valueerror-unknown-locale-utf-8 – bunji Sep 07 '16 at 17:20
  • Your locale is misconfigured; what does the `locale` tool (on the commandline, not Python) tell you is set? You *should* have a *language code*, then a dot and then `UTF-8`, not just `UTF-8` on its own, e.g. `en_US.UTF-8` or `en_CA.UTF-8`, etc. – Martijn Pieters Sep 07 '16 at 17:20
  • Not really the utf-8 problem. Maybe something wrong in pandas. Later I update my packages in conda-forge channel, everything works fine right now. – Chengfei He Sep 08 '16 at 16:58

0 Answers0