导入pandas时出错:'unicodeescape'编解码器无法解码字节

时间:2018-06-12 11:33:34

标签: python-3.x pandas centos

我刚刚在带有CentOS的服务器上使用virtualenv在虚拟环境中安装了pandas,numpy,matplotlib等。但是,当我尝试导入pandas时,我得到了以下错误:

>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/__init__.py", line 42, in <module>
from pandas.core.api import *
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/core/api.py", line 10, in <module>
from pandas.core.groupby.groupby import Grouper
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/core/groupby/__init__.py", line 2, in <module>
from pandas.core.groupby.groupby import (
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/core/groupby/groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/core/frame.py", line 74, in <module>
from pandas.core.series import Series
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/core/series.py", line 80, in <module>
import pandas.plotting._core as gfx
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/plotting/__init__.py", line 11, in <module>
from pandas.plotting._core import boxplot
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/plotting/_core.py", line 45, in <module>
from pandas.plotting import _converter
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/pandas/plotting/_converter.py", line 9, in <module>
import matplotlib.dates as dates
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/matplotlib/dates.py", line 165, in <module>
import matplotlib.ticker as ticker
File "/home/user/envs/dqn-docking/lib/python3.5/site-packages/matplotlib/ticker.py", line 564
return s.replace('-', '\N{MINUS SIGN}')
                                 ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-13: unknown Unicode character name

有任何线索吗? THX。

0 个答案:

没有答案