I pip installed pyfolio and was getting the same error.
After some digging I found this function :
def get_max_drawdown_underwater(underwater):
... And that the valley variable was ill-defined resulting in the returned variable being of type nump.int64 and not timestamp as stated in the function description.
vallay = underwater.index[np.argmin(underwater)] # np.argmin(underwater)
fixed this by changing line 893 in file timeseries.py
/usr/local/lib/python3.6/dist-packages/pyfolio/timeseries.py
how to change it on google colab or in jupyter ??