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'
Corley is spot on. You can solve the problem by changing 2 occurrences of "TimeSeries" to "Series" in /usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/qsdateutil.py. "TimeSeries" also appears once in /usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkutil/tsutil.py but I haven't encountered an error yet due to it.