AttributeError: 'module' object has no attribute 'TimeSeries' after python Validation.py

Viewed 2691

Just starting Computational Investing by Tucker Balch. I'm using virtualbox and installed Ubuntu. After installing QSTK, I ran python Validation.py (Step 7). I keep getting an:

AttributeError: 'module' object has no attribute 'TimeSeries'

There are many similar questions so I believe problem is the use of the same name as the file somewhere in the code. I was wondering if anyone had a solution specific to this class and QSTK.

The full error is:

Traceback (most recent call last):
 File "Validation.py", line 122 in <module>
  import QSTK.qstkutil.tsutil as tsu
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8 py2.7.egg/QSTK/qstkutil/tsutil.py", line 19, in <module>
  from QSTK.qstkutil import qsdateutil
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py", line 38, in <module>
  GTS_DATES = _cache_dates()
 File "usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py", line 36, in _cache_dates
  return pd.TimeSeries(index=dates, data=dates) 
AttributeError: 'module' object has no attribute 'TimeSeries' 
3 Answers

Changing TimeSeries to Series corrects the issue for me.

Seems that

import pandas as pd; 
pd.TimeSeries = pd.Series        

should work, but did not for me.

Related