alpaca-backtrader-api icon indicating copy to clipboard operation
alpaca-backtrader-api copied to clipboard

Cannot import alpaca-backtrader-api (Python 3.9.9 MacOS)

Open mitchweaver opened this issue 2 years ago • 5 comments

[~] python3
Python 3.9.9 (main, Nov 21 2021, 03:16:13)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import alpaca_backtrader_api
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/alpaca_backtrader_api/__init__.py", line 1, in <module>
    from .alpacastore import AlpacaStore
  File "/opt/homebrew/lib/python3.9/site-packages/alpaca_backtrader_api/alpacastore.py", line 12, in <module>
    import trading_calendars
  File "/opt/homebrew/lib/python3.9/site-packages/trading_calendars/__init__.py", line 16, in <module>
    from .trading_calendar import TradingCalendar
  File "/opt/homebrew/lib/python3.9/site-packages/trading_calendars/trading_calendar.py", line 33, in <module>
    from .calendar_helpers import (
  File "/opt/homebrew/lib/python3.9/site-packages/trading_calendars/calendar_helpers.py", line 6, in <module>
    NP_NAT = np.array([pd.NaT], dtype=np.int64)[0]
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NaTType'
>>>

Installed via pip3 install alpaca-backtrader-api

mitchweaver avatar Dec 22 '21 15:12 mitchweaver

Downgrading pandas from 1.3.5 to 1.2.5 has allowed me to import.

Should still state that this repo seems outdated. None of the examples work anymore.

mitchweaver avatar Dec 23 '21 15:12 mitchweaver

can confirm the same happens on ubuntu

loopiezlol avatar Dec 24 '21 13:12 loopiezlol

@mitchweaver @Loopiezlol Are you guys able to run the example in README.md? I keep getting an error. I will open an issue for this shortly.

cspipaon avatar Dec 29 '21 11:12 cspipaon

@cspipaon No, all the examples are broken.

mitchweaver avatar Dec 29 '21 18:12 mitchweaver

@mitchweaver I'm a new user to alpaca, is alpaca working for you at all or just the examples in README.md are broken? If I can get clarity from @cspipaon I can go in and help fix them or update the documentation as I have bandwidth this summer and want to start using/learning alpaca

datatalking avatar Jun 27 '22 08:06 datatalking