导入Pandas时出错

时间:2016-02-16 09:26:54

标签: python-2.7

导入pandas时出错。有人可以给我一些提示吗?我已经安装了pandas包。

追踪(最近一次呼叫最后一次):

文件“”,第1行,

文件“//anaconda/lib/python2.7/site-packages/pandas/init.py”,第44行,

from pandas.core.api import *

文件“//anaconda/lib/python2.7/site-packages/pandas/core/api.py”,第9行,

from pandas.core.groupby import Grouper

文件“//anaconda/lib/python2.7/site-packages/pandas/core/groupby.py”,第17行,

from pandas.core.frame import DataFrame

文件“//anaconda/lib/python2.7/site-packages/pandas/core/frame.py”,第41行,

from pandas.core.series import Series

文件“//anaconda/lib/python2.7/site-packages/pandas/core/series.py”,第2909行,

import pandas.tools.plotting as _gfx

文件“//anaconda/lib/python2.7/site-packages/pandas/tools/plotting.py”,第28行,

import pandas.tseries.converter as conv

文件“//anaconda/lib/python2.7/site-packages/pandas/tseries/converter.py”,第7行,

import matplotlib.units as units

文件“//anaconda/lib/python2.7/site-packages/matplotlib/init.py”,第1131行,

rcParams = rc_params()

文件“//anaconda/lib/python2.7/site-packages/matplotlib/init.py”,第975行,在rc_params中

return rc_params_from_file(fname, fail_on_error)

文件“//anaconda/lib/python2.7/site-packages/matplotlib/init.py”,第1100行,在rc_params_from_file中

config_from_file = _rc_params_in_file(fname, fail_on_error)

文件“//anaconda/lib/python2.7/site-packages/matplotlib/init.py”,第1018行,在_rc_params_in_file

with _open_file_or_url(fname) as fd:

文件“//anaconda/lib/python2.7/contextlib.py”,第17行,在输入

return self.gen.next()

文件“//anaconda/lib/python2.7/site-packages/matplotlib/init.py”,第1000行,在_open_file_or_url

encoding = locale.getdefaultlocale()[1]

文件“//anaconda/lib/python2.7/locale.py”,第543行,在getdefaultlocale中

return _parse_localename(localename)

文件“//anaconda/lib/python2.7/locale.py”,第475行,_parse_localename

raise ValueError, 'unknown locale: %s' % localename

ValueError:未知区域设置:UTF-8

1 个答案:

答案 0 :(得分:0)

经过一番搜索,我找到了答案。

基本上,在〜/ .bash_profile中添加一些行:

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