V1 to V2 (help)

Had no problems with V1 but now am unable to get past one line of code… Can anyone help me please.

Existing installation: alpaca-trade-api 1.5.1 and Python 3.9.0

from alpaca_trade_api.rest import REST, TimeFrame, TimeFrameUnit

#ImportError: cannot import name ‘TimeFrame’ from ‘alpaca_trade_api.rest’ (C:\python\lib\alpaca_trade_api\rest.py)

from alpaca_trade_api import TimeFrame

1 Like

You can also use strings instead of TimeFrame, but the available strings are kind of scattered and even undocumented in some cases.

1 Like

SOLVED: pip3 uninstall was not doing the job. I manually deleted the folders. pip3 installed from there and it works flawlessly.