0

我正在尝试使用yahoofinance.build_feedpyalgotrade(0.18 版)来构建一个包含 OHLC 数据的 cvs 文件。我不知道为什么会收到此错误。感谢您的任何帮助。


from pyalgotrade.tools import yahoofinance

instruments = ["orcl"]

feed = yahoofinance.build_feed(instruments, 2010, 2015, './csv', 86400, timezone=None, skipErrors=True)

不幸的是,我得到的错误是


>>> runfile('/home/marco/.config/spyder-py3/temp.py', wdir='/home/marco/.config/spyder-py3')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/marco/miniconda3/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
    execfile(filename, namespace)
  File "/home/marco/miniconda3/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)
  File "/home/marco/.config/spyder-py3/temp.py", line 8, in <module>
    from pyalgotrade.tools import yahoofinance
  File "/home/marco/miniconda3/lib/python3.5/site-packages/pyalgotrade/tools/yahoofinance.py", line 119
    except Exception, e:
                    ^
SyntaxError: invalid syntax

谢谢,马可。

4

1 回答 1

-1

尝试使用 Python 2.7 与 Python 3.4 相比,Python 2.7 是稳定的

于 2017-01-06T08:40:38.480 回答