Closed enriqueromualdez closed 7 years ago
Update:
I uninstalled then reinstalled via: pip install -r https://raw.githubusercontent.com/mhallsmoore/qstrader/master/requirements.txt
No issues with installation, but I've run into the same error once again. Any ideas folks?
More info:
python --version; Python 3.6.0 :: Continuum Analytics, Inc.
Update:
I was able to solve the issue by re-installing pandas using git clone. I then ran: python setup.py build_ext --inplace which seemed to solve the issue.. But now I'm faced with another bug.. yet again:
(qstraderp3) Enriques-MacBook-Air:examples enriqueromualdez$ python buy_and_hold_backtest.py
Traceback (most recent call last):
File "buy_and_hold_backtest.py", line 7, in
I've uninstalled distutils, seaborn, and matplotlib, then reinstalled it, to no avail. I've also tried modifying pd.version to pd.version.version, but I believe this syntax was deprecated after pandas 0.15?
Quite frustrating. Hope someone can help out on this. @mhallsmoore @femtotrader
Update:
Reinstalled everything once again. Backtest seems to be working, but now a new error...
While running buy_and_hold_backtest.py:
(qstraderp3) Enriques-MacBook-Air:examples enriqueromualdez$ python buy_and_hold_backtest.py
Traceback (most recent call last):
File "buy_and_hold_backtest.py", line 7, in
Creating this file
CSV_DATA_DIR: ~/data OUTPUT_DIR: ~/out
You still have to create directories with data and put your data in!
Backtest complete. Sharpe Ratio: 0.25 Max Drawdown: 79.59% Traceback (most recent call last): File "pandas/index.pyx", line 575, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:10990) File "pandas/hashtable.pyx", line 303, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6589) TypeError: an integer is required
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/indexes/base.py", line 1945, in get_loc return self._engine.get_loc(key) File "pandas/index.pyx", line 538, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11140) File "pandas/index.pyx", line 577, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11046) File "pandas/index.pyx", line 583, in pandas.index.DatetimeEngine._date_check_type (pandas/index.c:11210) KeyError: 'next'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "pandas/index.pyx", line 575, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:10990) File "pandas/hashtable.pyx", line 303, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6589) TypeError: an integer is required
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/tseries/index.py", line 1431, in get_loc return Index.get_loc(self, key, method, tolerance) File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/indexes/base.py", line 1947, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/index.pyx", line 538, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11140) File "pandas/index.pyx", line 577, in pandas.index.DatetimeEngine.get_loc (pandas/index.c:11046) File "pandas/index.pyx", line 583, in pandas.index.DatetimeEngine._date_check_type (pandas/index.c:11210) KeyError: 'next'
During handling of the above exception, another exception occurred:
ValueError: Error parsing datetime string "next" at position 0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "buy_and_hold_backtest.py", line 70, in
Hi,
Could you let me know which version of Pandas you're running?
Cheers,
Mike.
Hi Mike,
Python3 pandas.version 0.19.2.
I actually got the backtest to run, but I’ve run into another issue. I’ve posted it on ticket #205.
Thanks,
Enrique
On May 31, 2017, at 5:30 PM, Michael Halls-Moore notifications@github.com wrote:
Hi,
Could you let me know which version of Pandas you're running?
Cheers,
Mike.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mhallsmoore/qstrader/issues/205#issuecomment-305137073, or mute the thread https://github.com/notifications/unsubscribe-auth/AbsmIv22BBlMVKVmQ_Lv82UWsS4EaYmeks5r_TMhgaJpZM4Npcv1.
Hi Enrique,
As it happens we've not yet built tests against Python 3.6 - only for Python 2.7, 3.4 and 3.5 I believe. It looks like this might in fact be a bug in Pandas itself when run in Python 3.6:
Do you have access to a Python 3.5 distribution? That might help you get it working.
Kind regards,
Mike.
Hey Mike,
Oh I see…Best then to uninstall Anaconda and re-install the 3.5 distribution?
Cheers,
Enrique
On May 31, 2017, at 5:46 PM, Michael Halls-Moore notifications@github.com wrote:
Hi Enrique,
As it happens we've not yet built tests against Python 3.6 - only for Python 2.7, 3.4 and 3.5 I believe. It looks like this might in fact be a bug in Pandas itself when run in Python 3.6:
pandas-dev/pandas#14561 https://github.com/pandas-dev/pandas/issues/14561 https://stackoverflow.com/questions/42595429/how-to-convert-pd-series-to-datetime https://stackoverflow.com/questions/42595429/how-to-convert-pd-series-to-datetime Do you have access to a Python 3.5 distribution? That might help you get it working.
Kind regards,
Mike.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mhallsmoore/qstrader/issues/205#issuecomment-305141109, or mute the thread https://github.com/notifications/unsubscribe-auth/AbsmIgHUUr3WkCsYLtvoNuIsH-fMN64Oks5r_Tb1gaJpZM4Npcv1.
Indeed, that's probably the best bet. If you still get some errors after that, post them here!
Also - just to let you know I think the Tearsheet has defaulted to being switched off when backtests are carried out, but it can be enabled quite easily. Let me know once you have a functioning backtest and I'll help you switch it on again!
Much appreciated, Mike. I’ll give it a shot and get back to you!
On May 31, 2017, at 5:52 PM, Michael Halls-Moore notifications@github.com wrote:
Indeed, that's probably the best bet. If you still get some errors after that, post them here!
Also - just to let you know I think the Tearsheet has defaulted to being switched off when backtests are carried out, but it can be enabled quite easily. Let me know once you have a functioning backtest and I'll help you switch it on again!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mhallsmoore/qstrader/issues/205#issuecomment-305142569, or mute the thread https://github.com/notifications/unsubscribe-auth/AbsmIuSY7vtn4yRZiGY7ouXmY8H7mJzvks5r_ThTgaJpZM4Npcv1.
Got it working! Read about the solution in a previous post: https://github.com/mhallsmoore/qstrader/issues/203
Some Mac users may also experience a bug with Matplotlib and it's backend settings in site-packages/matplotlib/matplotlibrc. A quick fix was to change the backend from macosx to TkAgg.
Thank you very much for your help, Mike! Looking forward to making use of QSTrader. Cheers!
Hi all,
Ran into this issue when trying to run the buy_and_hold_backtest.py:
(qstraderp3) Enriques-MacBook-Air:examples enriqueromualdez$ python buy_and_hold_backtest.py Traceback (most recent call last): File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/init.py", line 25, in
from pandas import hashtable, tslib, lib
ImportError: dlopen(/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so, 2): Symbol not found: _PySlice_AdjustIndices
Referenced from: /Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "buy_and_hold_backtest.py", line 7, in
from qstrader.trading_session import TradingSession
File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/qstrader/trading_session.py", line 5, in
from .price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler
File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/qstrader/price_handler/yahoo_daily_csv_bar.py", line 3, in
import pandas as pd
File "/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/init.py", line 31, in
"extensions first.".format(module))
ImportError: C extension: dlopen(/Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so, 2): Symbol not found: _PySlice_AdjustIndices
Referenced from: /Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so
Expected in: flat namespace
in /Users/enriqueromualdez/venv/qstraderp3/lib/python3.6/site-packages/pandas/lib.cpython-36m-darwin.so not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
Not sure where to go from here.. I did manually pip install yaml and munch to satisfy "no module" errors prior to this.