Closed fumoboy007 closed 9 months ago
Is there any way I can install this with Python 3.11? I still have issue with aiohttp
@datttran just move your code to the new official SDK alpaca-py
alpaca-py
is fully compatible with Python 3.11.
@sshcli alpaca-py is fully compatible with 3.11 but the New API is not included in alpaca-py it's only in the alpaca-trade-api which is not compatible with 3.11
Name: aiohttp Version: 3.8.3
@alighten-dev @datttran @fumoboy007 the alpaca-trade-api
is no longer supported.
Just install alpaca-py
and use the following code:
from alpaca.trading.client import TradingClient # For trading api
from alpaca.data import StockHistoricalDataClient # For data
api_key= 'xxxxxxxxxxxxxxxxxxxx'
api_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxx'
api = TradingClient(api_key, api_secret, paper=True)
data = StockHistoricalDataClient(api_key, api_secret )
Ok so @sshcli, it seems this definitely fixes the build/install-related issue, however when trying to run any of the example historical data scripts from Alpaca's docs, they all lead to an ominous 400 error in python 3.11, however after switching to 3.9 in my virtual environment, everything works perfectly.
@BaileySimrell most of the docs and examples you will find out there are still making reference to the old sdk alpaca-trade-api
In terms of docs, this is the start point for the new sdk alpaca-py
:
https://alpaca.markets/docs/python-sdk/api_reference/index.html
@sshcli yes, I have definitely realized that ... though the examples from the getting started alpaca-py reference you sent did not work on python 3.11 on my machine. after switching to 3.9, they all worked.
Is there an existing issue for this?
Current Behavior
Using Python 3.11,
pip install alpaca-trade-api~=2.0
fails with the following error for theaiohttp
dependency:Expected Behavior
pip install alpaca-trade-api~=2.0
with Python 3.11 should succeed.SDK Version I encountered this issue in
2.3.0
Steps To Reproduce
Filled out the Steps to Reproduce section?
Anything else?
This issue has already been fixed starting with
aiohttp
version 3.8.3. However, thealpaca-trade-api
package pins itsaiohttp
dependency to version 3.8.1. We should use a less restrictive requirement specification so that futureaiohttp
fixes are brought in automatically.