alpacahq / alpaca-trade-api-python

Python client for Alpaca's trade API
https://pypi.org/project/alpaca-trade-api/
Apache License 2.0
1.73k stars 534 forks source link

[Bug]: Installation error: command '/usr/bin/clang' failed with exit code 1 on macOS Ventura 13.3.1 and Python 3.11.3 and Python 3.10.11 #700

Closed mcharles42 closed 7 months ago

mcharles42 commented 1 year ago

Is there an existing issue for this?

Current Behavior

Hello,

I'm new to coding and have encountered an issue while trying to install the alpaca-trade-api package using pip on my macOS Ventura 13.3.1 system with Python 3.11.3. I also uninstalled Python 3.11.3 and redid the following process with Python 3.10.11, which is now what I currently have running.

Here's a summary of the issue and the troubleshooting steps I've taken so far:

Initially, I tried running pip install alpha_vantage alpaca-trade-api pandas scikit-learn numpy. This resulted in the following error:

vbnet Copy code error: command '/usr/bin/clang' failed with exit code 1 ERROR: Failed building wheel for aiohttp Failed to build aiohttp ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects I updated pip, setuptools, and wheel, installed required dependencies, and installed the other packages individually. The installation for aiohttp and other packages (except alpaca-trade-api) was successful.

When trying to install alpaca-trade-api individually, I encountered the same error as before:

vbnet Copy code error: command '/usr/bin/clang' failed with exit code 1 ERROR: Failed building wheel for aiohttp Failed to build aiohttp ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects I installed the development version of alpaca-trade-api from the GitHub repository and additional dependencies for macOS (openssl@1.1, pkg-config, libffi) using Homebrew. However, the same error persisted.

I tried installing the cryptography package manually (since it's a dependency for alpaca-trade-api) and set the environment variables for cryptography on macOS. The installation of cryptography was successful, but the error for alpaca-trade-api remained the same.

Finally, I attempted to install cryptography and alpaca-trade-api using the --no-binary option. This resulted in another error related to the package's setup.py file:

vbnet Copy code FileNotFoundError: [Errno 2] No such file or directory: 'requirements/requirements.txt' Could you please help me resolve this issue, or provide guidance on how to install the alpaca-trade-api package on my system?

Expected Behavior

It should install.

SDK Version I encountered this issue in

Latest

Steps To Reproduce

See current behavior.

Filled out the Steps to Reproduce section?

Anything else?

I am brand new to coding and am teaching myself in my spare time with chatgpt, so I am sorry if this is a dumb question.

brettelliot commented 1 year ago

According to this aiohttp 3.8.1 doesnt work on python 3.11.

Need these: aiohttp==3.8.2 yarl==1.8.1 frozenlist==1.3.1

So im not sure how to make this work on 3.11.

mguddeti commented 1 year ago

@brettelliot do you suggest downgrading the version to install?

brettelliot commented 1 year ago

Alpaca wants us to stop using this lib. I'm asking them to make alpaca-py work with python 3.11 instead of trying to use this lib anymore.

hiohiohio commented 7 months ago

close this issue as v3.2.0 is released. https://github.com/alpacahq/alpaca-trade-api-python/releases/tag/v3.2.0

Please note that we have deprecated this SDK alpaca-trade-api-python and recommend to use alpaca-py