alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
505 stars 125 forks source link

[Bug]: Websockets conflict #387

Closed sshcli closed 3 weeks ago

sshcli commented 7 months ago

Is there an existing issue for this?

Current Behavior

When you use both alpaca-py and alpaca-trade-api , you get the following conflict when upgrading to alpaca-py 0.13.4:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
alpaca-trade-api 3.0.2 requires websockets<11,>=9.0, but you have websockets 11.0.3 which is incompatible.
pyppeteer 1.0.2 requires websockets<11.0,>=10.0, but you have websockets 11.0.3 which is incompatible.
Successfully installed alpaca-py-0.13.4 websockets-11.0.3

Expected Behavior

Because alpaca-trade-api is still needed for some functions not available yet in alpaca-py (E.g. get_activities() ) Some changes must be made to avoid this conflict.

SDK Version I encountered this issue in

alpaca-py 0.13.4

Steps To Reproduce

1. Install alpaca-trade-api 3.0.2
2. Install alpaca-py 0.13.4

Filled out the Steps to Reproduce section?

Anything else?

Migrate all features from old alpaca-trade-api to the new alpaca-py, so people don't need to use alpaca-trade-api anymore

hiohiohio commented 7 months ago

Migrate all features from old alpaca-trade-api to the new alpaca-py, so people don't need to use alpaca-trade-api anymore

Agree. Please let me consider to support missing features of alpaca-py.

coininstant commented 5 months ago

Running into this same issue: !pip install --upgrade setuptools !pip install --upgrade pandas !pip install "websockets<11" (exhausted all attempts here) !pip install jedi fastapi kaleido python-multipart uvicorn !apt-get install swig !pip install wrds !pip install git+https://github.com/AI4Finance-LLC/FinRL-Library.git !pip install pyfolio !pip install yfinance !pip install alpaca-trade-api !pip install alpaca-trade-api==3.2.0 !pip install alpaca-py !pip install pyfolio ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. alpaca-py 0.14.0 requires websockets<12.0.0,>=11.0.3, but you have websockets 10.4 which is incompatible.

For now i'm trying to find a workaround for the dependency conflict, such as using virtual environments to separate projects that depend on alpaca-trade-api and alpaca-py

hiohiohio commented 3 weeks ago

I have merged https://github.com/alpacahq/alpaca-py/pull/435 a while ago. This allows you to install both alpaca-trade-api and alpaca-py at the same time. But please note that we deprecated alpaca-trade-api and no more update. Alpaca-py gradually covers all the functionality. Therefore, please migrate from alpaca-trader-api to alpaca-py.