I’m using python 3.11.0.
I ran: pip install alpaca-py
I’m now trying to run this from the examples:
from alpaca.data.historical import StockHistoricalDataClient
from alpaca.data.requests import StockBarsRequest
from alpaca.data.timeframe import TimeFrame
client = StockHistoricalDataClient()
request_params = StockBarsRequest(
symbol_or_symbols=["AAPL", "MSFT"],
timeframe=TimeFrame.Day,
start="2022-11-01"
)
bars = client.get_stock_bars(request_params)
print(bars)
I’m getting this error: ModuleNotFoundError: No module named ‘alpaca.data’; ‘alpaca’ is not a package
I’ve done a few restart/reimport type of activities but nothing works.
The code autocompletes and “compiles” nicely. It just won’t run.