Skip to content
Advertisement

Can’t install alpaca_trade_api

I tried using pip install alpaca_trade_api and it errored out with exit status 1. I also tried pip install alpaca-trade-api and it had the same errors.

I get a ton of errors including this one:

ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0b/qkyt93xx5ts8vf6lm8v7txxm0000gn/T/pip-install-ibu2qfpj/numpy_4257e6a256ca4130b766e6132889a532/setup.py'"'"'; __file__='"'"'/private/var/folders/0b/qkyt93xx5ts8vf6lm8v7txxm0000gn/T/pip-install-ibu2qfpj/numpy_4257e6a256ca4130b766e6132889a532/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/0b/qkyt93xx5ts8vf6lm8v7txxm0000gn/T/pip-record-w_zd6k6r/install-record.txt --single-version-externally-managed --prefix /private/var/folders/0b/qkyt93xx5ts8vf6lm8v7txxm0000gn/T/pip-build-env-ers_d9cp/overlay --compile --install-headers /private/var/folders/0b/qkyt93xx5ts8vf6lm8v7txxm0000gn/T/pip-build-env-ers_d9cp/overlay/include/python3.8/numpy Check the logs for full command output.

Additionally the command takes forever to run.

I think this may have to do with me upgrading pip and pip3 and accidentally using sudo to upgrade and install them.

What can I do to fix this.

Advertisement

Answer

I resolved the issue. The issue was with installing pandas and numpy per Pip install pandas results in error (Python3.8, Pycharm, Apple Silicon)

To fix:

  1. Install brew using
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install openblas followed by numpy and pandas using brew
brew install openblas
OPENBLAS="$(brew --prefix openblas)" pip install numpy pandas
  1. Install alpaca trade api
pip install alpaca_trade_api

Thanks for all the help!

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement