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('"'"'\r\n'"'"', '"'"'\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.

3

2 Answers

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 )"
  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!

$ pip install alpaca-trade-api

Collecting alpaca-trade-api
      Downloading alpaca_trade_api-1.2.1-py3-none-any.whl (39 kB)
    Collecting urllib3<2,>1.24
      Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
         |████████████████████████████████| 153 kB 354 kB/s 
    Collecting websockets<9,>=8.0
      Downloading websockets-8.1.tar.gz (58 kB)
         |████████████████████████████████| 58 kB 345 kB/s 
    Collecting numpy
      Downloading numpy-1.20.2-cp39-cp39-manylinux2010_x86_64.whl (15.4 MB)
         |████████████████████████████████| 15.4 MB 886 kB/s 
    Collecting msgpack==1.0.2
      Downloading msgpack-1.0.2-cp39-cp39-manylinux1_x86_64.whl (294 kB)
         |████████████████████████████████| 294 kB 4.3 MB/s 
    Collecting websocket-client<1,>=0.56.0
      Downloading websocket_client-0.59.0-py2.py3-none-any.whl (67 kB)
         |████████████████████████████████| 67 kB 690 kB/s 
    Collecting pandas
      Downloading pandas-1.2.4-cp39-cp39-manylinux1_x86_64.whl (9.7 MB)
         |████████████████████████████████| 9.7 MB 4.5 MB/s 
    Collecting requests<3,>2
      Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
    Collecting six
      Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
    Collecting pytz>=2017.3
      Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
    Collecting python-dateutil>=2.7.3
      Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
    Collecting chardet<5,>=3.0.2
      Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
    Collecting certifi>=2017.4.17
      Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
    Collecting idna<3,>=2.5
      Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
    Using legacy 'setup.py install' for websockets, since package 'wheel' is not installed.
    Installing collected packages: urllib3, websockets, numpy, msgpack, six, websocket-client, pytz, python-dateutil, pandas, chardet, certifi, idna, requests, alpaca-trade-api
        Running setup.py install for websockets ... done
    Successfully installed alpaca-trade-api-1.2.1 certifi-2020.12.5 chardet-4.0.0 idna-2.10 msgpack-1.0.2 numpy-1.20.2 pandas-1.2.4 python-
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest