Unable to install alpaca-trade-api on Python 3.12.0

Hi all,

Has anyone seen this kind of error when trying to install Alpaca Trade API ?

I am using Python 3.12.0

My pip list:

Package Version


alpaca-py 0.13.3
annotated-types 0.6.0
appnope 0.1.3
asttokens 2.4.1
certifi 2023.11.17
charset-normalizer 3.3.2
comm 0.2.0
contourpy 1.2.0
cycler 0.12.1
Cython 3.0.6
debugpy 1.8.0
decorator 5.1.1
executing 2.0.1
fonttools 4.45.1
idna 3.6
ipykernel 6.26.0
ipython 8.18.1
jedi 0.19.1
jupyter_client 8.6.0
jupyter_core 5.5.0
kiwisolver 1.4.5
matplotlib 3.8.2
matplotlib-inline 0.1.6
msgpack 1.0.7
nest-asyncio 1.5.8
numpy 1.26.2
packaging 23.2
pandas 2.1.3
parso 0.8.3
pexpect 4.9.0
Pillow 10.1.0
pip 23.3.1
platformdirs 4.0.0
prompt-toolkit 3.0.41
psutil 5.9.6
ptyprocess 0.7.0
pure-eval 0.2.2
pydantic 2.5.2
pydantic_core 2.14.5
Pygments 2.17.2
pyparsing 3.1.1
python-dateutil 2.8.2
pytz 2023.3.post1
PyYAML 5.4.1
pyzmq 25.1.1
requests 2.31.0
setuptools 69.0.2
six 1.16.0
sseclient-py 1.8.0
stack-data 0.6.3
tornado 6.3.3
traitlets 5.14.0
typing_extensions 4.8.0
tzdata 2023.3
urllib3 2.1.0
wcwidth 0.2.12
websockets 11.0.3
wheel 0.42.0
Note: you may need to restart the kernel to use updated packages.

(venv) pavdylon@Pavs-iMac ~ % pip install alpaca-trade-api
Collecting alpaca-trade-api
Using cached alpaca_trade_api-3.0.2-py3-none-any.whl.metadata (29 kB)
Collecting pandas>=0.18.1 (from alpaca-trade-api)
Using cached pandas-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl.metadata (18 kB)
Collecting numpy>=1.11.1 (from alpaca-trade-api)
Using cached numpy-1.26.2-cp312-cp312-macosx_10_9_x86_64.whl.metadata (61 kB)
Collecting requests<3,>2 (from alpaca-trade-api)
Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting urllib3<2,>1.24 (from alpaca-trade-api)
Using cached urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
Collecting websocket-client<2,>=0.56.0 (from alpaca-trade-api)
Using cached websocket_client-1.6.4-py3-none-any.whl.metadata (7.7 kB)
Collecting websockets<11,>=9.0 (from alpaca-trade-api)
Using cached websockets-10.4.tar.gz (84 kB)
Preparing metadata (setup.py) … done
Collecting msgpack==1.0.3 (from alpaca-trade-api)
Using cached msgpack-1.0.3.tar.gz (123 kB)
Preparing metadata (setup.py) … done
Collecting aiohttp==3.8.2 (from alpaca-trade-api)
Using cached aiohttp-3.8.2.tar.gz (7.3 MB)
Installing build dependencies … done
Getting requirements to build wheel … done
Installing backend dependencies … done
Preparing metadata (pyproject.toml) … done
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
Traceback (most recent call last):
File “/Users/pavdylon/venv/lib/python3.12/site-packages/pip/vendor/pyproject_hooks/in_process/in_process.py", line 353, in
main()
File “/Users/pavdylon/venv/lib/python3.12/site-packages/pip/vendor/pyproject_hooks/in_process/in_process.py", line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/pavdylon/venv/lib/python3.12/site-packages/pip/vendor/pyproject_hooks/in_process/in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self.get_build_requires(config_settings, requirements=[‘wheel’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in get_build_requires
self.run_setup()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File “”, line 288, in
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/init.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/dist.py”, line 963, in run_command
super().run_command(command)
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
self.find_sources()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
mm.run()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py”, line 551, in run
self.add_defaults()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
sdist.add_defaults(self)
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 112, in add_defaults
super().add_defaults()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py”, line 251, in add_defaults
self.add_defaults_ext()
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 336, in add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 204, in get_source_files
File "/private/var/folders/7
/twkgcq8n7wx2ytfr3njpk_kw0000gn/T/pip-build-env-vnvy13_u/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in getattr
raise AttributeError(attr)
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.

Thanks,

Pav