Python Forum

Full Version: TA-Lib pip install not working Mac (Fix Found)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Whats up everyone, hoping someone has an ideas as I have tried everything I can find to make this work.

Running iOS BigSur with Python 3.9.1 64bit.

Ran brew install ta-lib - worked
Ran on ENV pip install TA-Lib (BIG ASS RED ERROR)
tried on system pip3 install TA-Lib (Big ASS RED ERROR)
update: I tried installing with Python 3.7.9 and this also does not work

Error starts with- ERROR: Command errored out with exit status 1: and runs 30 to 40 lines.

Does any of you have a fix for this? Is it the Python version I am running or a 32vs64 bit issue?

Mentioned this bellow, but here is the fix for anyone in the future:

I found the solution!!!! Finally

1) brew install ta-lib
2) xcode-select --install
3) pip3 install TA-Lib
3-1) if you have multiple version of python on your system (i.e, 3.7 and 3.9) you must specify the version you want. For instance pip3.7 install TA-Lib or pip3.9. etc
-- if you just use pip3 install, it will use the lower version of python installed, than other modules may need to be specified at that module. For example, I used pip3 install TA-Lib(which worked), but than when I installed flask(as I have 3.7 and 3.9) Flask kept failing until I specified pip3.9 install ta-Lib and pip3.9 install flask. worked also with pip3 install TA-Lib and pip3.7 install Flask.

It is best to just identify both off the bat with the specific version of python you are using: pip3.7 or pip 3.9 install WhateverYouAreInstalling
Can you show the error? "exit status 1" doesn't mean anything by itself.
(Jan-14-2021, 10:51 PM)bowlofred Wrote: [ -> ]Can you show the error? "exit status 1" doesn't mean anything by itself.

ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-install-aysiu8ei/TA-Lib/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-install-aysiu8ei/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-record-s9dxej5t/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/TA-Lib
cwd: /private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-install-aysiu8ei/TA-Lib/
Complete output (22 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/abstract.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/test_abstract.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/deprecated.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/stream.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/test_pandas.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/test_data.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/test_func.py -> build/lib.macosx-10.9-x86_64-3.7/talib
copying talib/test_stream.py -> build/lib.macosx-10.9-x86_64-3.7/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/talib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c talib/_ta_lib.c -o build/temp.macosx-10.9-x86_64-3.7/talib/_ta_lib.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-install-aysiu8ei/TA-Lib/setup.py'"'"'; __file__='"'"'/private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-install-aysiu8ei/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1r/zf6cc3ds5rxbp5_n67z4nks80000gn/T/pip-record-s9dxej5t/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m/TA-Lib Check the logs for full command output.
I found the solution!!!! Finally

1) brew install ta-lib
2) xcode-select --install
3) pip3 install TA-Lib