[python][pandas]No module named 'pandas.lib'

错误:import pandas as pd 报错 “No module named 'pandas.lib'”
原因:安装了ggplot, 与pandas有兼容问题
解决:
修改anaconda3\Lib\site-packages\ggplot\stats\smoothers.py:
注释这句:from pandas.lib import Timestamp
date_types = (
pd.tslib.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
pd.tslib.Timestamp修改为pd.Timestamp

修改anaconda3\Lib\site-packages\ggplot\utils.py:
date_types = (
pd.tslib.Timestamp,
pd.DatetimeIndex,
pd.Period,
pd.PeriodIndex,
datetime.datetime,
datetime.time
)
pd.tslib.Timestamp修改为pd.Timestamp

你可能感兴趣的:([python][pandas]No module named 'pandas.lib')