Pylivetrader: HTTPError: unauthorized on alpaca

I am trying to run the simple example on the pylivetrader github page. When I do so, I get an unauthorized message:

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url:

I have already gone into the Polygon REST and changed from api.polygon. io to ‘’. I have also tried with both v1 and v2. I have uninstalled/reinstalled both the pylivetrader and alpaca_trade_api.

If I leave it with V2, then I get the following error message:

[2020-05-11 16:02:00.700034] WARNING: Alpaca: 404 Client Error: Not Found for url:

[2020-05-11 16:02:00.702945] ERROR: Executor: ‘Index’ object has no attribute ‘swaplevel’

My env vars are:




In order to access Polygon API, you have to have live brokerage account opened. We are updating pylivetrader to use Alpaca data API by default (with a choice of Polygon)