这是第2行,python代码

import tia.analysis.talib_wrapper as talib


控制台显示

  File "t10.py", line 2, in <module>
    import tia.analysis.talib_wrapper as talib
  File "/home/jholmes/anaconda3/lib/python3.6/site-packages/tia/analysis/__init__.py", line 2, in <module>
    from tia.analysis.model import *
ModuleNotFoundError: No module named 'tia.analysis.model'


为什么无法识别模块?我安装了tia
点安装。

examples中的其他代码甚至带来了更疯狂的问题。

from tia.bbg import LocalTerminal
import pandas as pd

resp = LocalTerminal.get_reference_data('MSFT US EQUITY', ['PX_LAST', 'GICS_SECTOR_NAME', 'VOLATILITY_30D'])
resp.as_frame()


我有

  File "t11.py", line 1, in <module>
    from tia.bbg import LocalTerminal
  File "/home/jholmes/anaconda3/lib/python3.6/site-packages/tia/bbg/__init__.py", line 1, in <module>
    from tia.bbg.v3api import *
  File "/home/jholmes/anaconda3/lib/python3.6/site-packages/tia/bbg/v3api.py", line 186
    print 'unhandled event: %s' % evt.EventType
                              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(int 'unhandled event: %s' % evt.EventType)?


仅一个证明包在这里

pip install tia
Requirement already satisfied: tia in ./anaconda3/lib/python3.6/site-packages
Requirement already satisfied: pandas in ./anaconda3/lib/python3.6/site-packages (from tia)
Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from tia)
Requirement already satisfied: python-dateutil>=2 in ./anaconda3/lib/python3.6/site-packages (from pandas->tia)
Requirement already satisfied: pytz>=2011k in ./anaconda3/lib/python3.6/site-packages (from pandas->tia)
Requirement already satisfied: six>=1.5 in ./anaconda3/lib/python3.6/site-packages (from python-dateutil>=2->pandas->tia)

最佳答案

tia github页明确表示该库仅与python 2.7兼容。所以我想这就是问题所在。

08-20 03:28