Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mitchweaver opened this issue Dec 22, 2021 · 5 comments
Open

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

mitchweaver opened this issue Dec 22, 2021 · 5 comments

Comments

@mitchweaver
Copy link

[~] 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
Copy link
Author

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.

@loopiezlol
Copy link

can confirm the same happens on ubuntu

@cspipaon
Copy link

@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.

@mitchweaver
Copy link
Author

@cspipaon No, all the examples are broken.

@datatalking
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants