# Install alpaca\_trading\_api

**URL:** <https://forum.alpaca.markets/t/install-alpaca-trading-api/13142>\
**Category:** Getting Started with Alpaca\
**Created:** [November 13, 2023, 2:21pm UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142 "2023-11-13T14:21:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Camillo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/camillo/32/5569_2.png) [@Camillo](https://forum.alpaca.markets/u/Camillo)\
**Post date:** [November 13, 2023, 2:21pm UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142/1 "2023-11-13T14:21:58Z")

</div>

```auto
I have tried to install alpaca_trade_api several times with pip, and each time the following error occurs:
Collecting PyYAML==6.0 (from alpaca_trade_api)
  Using cached PyYAML-6.0.tar.gz (124 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
--------------------------------------------------------------------------------------
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running egg_info
      writing lib\PyYAML.egg-info\PKG-INFO
      writing dependency_links to lib\PyYAML.egg-info\dependency_links.txt
      writing top-level names to lib\PyYAML.egg-info\top_level.txt

AttributeError: cython_sources
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
To solve it, I performed the following actions on the advice of GPT and Bard:
•	Uninstalled and reinstalled PyYAML (with pip and by downloading the .whl file directly from the website - https://pypi.org/project/PyYAML/), Pandas, and Cython.
•	Updated pip
But I'm still stuck. Can you tell me why?
I am using Python 3.12 64-bit.

```

---

<div class="post-metadata">

**Author:** ![dan\_whitnable](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable/32/1323_2.png) [@dan\_whitnable](https://forum.alpaca.markets/u/dan_whitnable)\
**Post date:** [November 13, 2023, 3:44pm UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142/2 "2023-11-13T15:44:16Z")

</div>

@Camillo The [alpaca-trading-api](https://github.com/alpacahq/alpaca-trade-api-python) doesn’t support python versions above 3.8 and is understandable it may run into install issues with version 3.12. You can either load python 3.8 or use the newer [alpaca-py](https://github.com/alpacahq/alpaca-py) SDK instead. That should work.

---

<div class="post-metadata">

**Author:** ![Camillo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/camillo/32/5569_2.png) [@Camillo](https://forum.alpaca.markets/u/Camillo)\
**Post date:** [November 15, 2023, 1:55pm UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142/3 "2023-11-15T13:55:30Z")

</div>

Thank you so much, do you suggest to use the older version of python or the newer alpaca-py? Because I’ve seen on the web that there are lot of tutorials that refer to alpaca-trading-api but none to alpaca-py…I don’t know if there’s a difference, but I had already installed Alpaca-py, and some commands that required the import of Alpaca-trade-api were not working.

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [November 15, 2023, 2:24pm UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142/4 "2023-11-15T14:24:23Z")

</div>

@Camillo I personally use the original [alpaca-trading-api](https://github.com/alpacahq/alpaca-trade-api-python) partly because I have a lot of code that used that SDK but also because it’s a bit more ‘friendly’. What I mean by that is the newer alpaca-py SDK expects just about everything to be an object whereas alpaca-trading-api accepts simple strings for most inputs and parameters.

Especially if you are using examples which use the alpaca-trading-api SDK you may want to revert to an earlier supported version of python.

Do you by chance use [Google Colab](https://colab.research.google.com/). I highly recommend that as a very convenient way to access all the Alpaca APIs in a python notebook environment. It’s free and easy to load the SDKs and are pretty much guaranteed to work using the default Colab notebook versions.

---

<div class="post-metadata">

**Author:** ![Camillo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/camillo/32/5569_2.png) [@Camillo](https://forum.alpaca.markets/u/Camillo)\
**Post date:** [November 17, 2023, 8:51am UTC](https://forum.alpaca.markets/t/install-alpaca-trading-api/13142/5 "2023-11-17T08:51:13Z")

</div>

Ok, thank you so much for your support! I will try google collab
